UVA 11185 - Ternary UVA • Sep 1, 2020 Problem PDFSolution:#include int main() { long long i,n,j,b[10000]; while(scanf("%lld",&n)) { if(n<0) break; else if(n==0) { printf("0\n"); } else { i=0; while(n>0) { b[i]=n%3; n=n/3; i++; } i=i-1; for(j=i;j>=0;j--) printf("%lld",b[j]); printf("\n"); } } return 0; } https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/11185/11185.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