1 #include<stdio.h>
2 int main()
3 {
4 int n,m,i,r,top = 0;
5 char stack[100];
6 scanf("%d%d", &n,&m);
7 while(n)
8 {
9 top++;
10 stack[top] = n%m;
11 n = n/m;
12 }
13 while(top!=0)
14 {
15 printf("%d", stack[top]);
16 top--;
17 }
18 printf("\n");
19 return 0 ;
20 }