UVA 10018 - Reverse and Add UVA • Sep 1, 2020 Problem PDFSolution:#include 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; } https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/10018/10018.cpp Tags UVA Competitive Programming Shipu Ahamed Recommended for you UVA UVA 913 - Joana and the Odd Numbers 4 years ago • 1 min read UVA UVA 871 - Counting Cells in a Blob 4 years ago • 3 min read UVA UVA 866 - Intersecting Line Segments 4 years ago • 3 min read