Download uva_cpp_clean/100/100-5.cpp from slayone/uva_spoj_raw: direct link, hf CLI and curl.
- Browser
- Download file 388 Bytes
-
https://huggingface.co/datasets/slayone/uva_spoj_raw/resolve/main/uva_cpp_clean/100/100-5.cpp
- Command line
-
hf download hf://datasets/slayone/uva_spoj_raw/uva_cpp_clean/100/100-5.cpp
-
curl -L -o 100-5.cpp https://huggingface.co/datasets/slayone/uva_spoj_raw/resolve/main/uva_cpp_clean/100/100-5.cpp
388 Bytes
| int main() | |
| { | |
| int n,m,i,k,j,c,s; | |
| while(scanf("%d %d",&n,&m)==2) | |
| { | |
| s=0; | |
| printf("%d %d ",n,m); | |
| if(n>m) | |
| { | |
| k=m; | |
| m=n; | |
| n=k; | |
| } | |
| for(i=n;i<=m;i++) | |
| { | |
| c=1; | |
| j=i; | |
| while(j>1) | |
| { | |
| if(j%2==0) | |
| j=j/2; | |
| else | |
| j=(3*j)+1; | |
| c++; | |
| } | |
| if(c>=s) | |
| s=c; | |
| } | |
| printf("%d\n",s); | |
| } | |
| return 0; | |
| } | |