base convert by croyal

#include<stdio.h>
main(){int n,b,p=0,a[99];while(scanf("%d %d",&n,&b)>0){while(n>=b){a[p]=n%b;p++;n=n/b;}if(n>0){a[p]=n;p++;}while(p>0){p--;printf("%d",a[p]);}printf("\n");}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page