Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- long long n,i,ter[1000],l,mod;
- while(scanf("%lld",&n)==1)
- {
- if(n<0)
- break;
- for(i=1;i<=100;i++)
- {
- ter[i]=n%3;
- n=n/3;
- if(n==0)
- {
- l=i;
- break;
- }
- }
- for(i=l;i>0;i--)
- {
- mod=ter[i];
- printf("%lld",mod);
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement