Download uva_cpp_clean/10018/10018-5.cpp from slayone/uva_spoj_raw: direct link, hf CLI and curl.
- Browser
- Download file 593 Bytes
-
https://huggingface.co/datasets/slayone/uva_spoj_raw/resolve/main/uva_cpp_clean/10018/10018-5.cpp
- Command line
-
hf download hf://datasets/slayone/uva_spoj_raw/uva_cpp_clean/10018/10018-5.cpp
-
curl -L -o 10018-5.cpp https://huggingface.co/datasets/slayone/uva_spoj_raw/resolve/main/uva_cpp_clean/10018/10018-5.cpp
593 Bytes
| int main() | |
| { | |
| long long n,a,s,c; | |
| int t,i; | |
| while(scanf("%d",&t)==1) | |
| { | |
| for(i=1;i<=t;i++) | |
| { | |
| scanf("%lld",&n); | |
| a=n; | |
| c=0; | |
| while(1) | |
| { | |
| s=0; | |
| while(n!=0) | |
| { | |
| s=s*10+n%10; | |
| n/=10; | |
| } | |
| if(s==a) | |
| break; | |
| else | |
| { | |
| n=s+a; | |
| a=s+a; | |
| c++; | |
| } | |
| } | |
| printf("%lld %lld\n",c,a); | |
| } | |
| } | |
| return 0; | |
| } | |