1 #include<cstdio>
 2 using namespace std;
 3 int n,m,res,a[101],en;
 4 int main()
 5 {
 6     scanf("%d%d",&n,&m);
 7     while(n)
 8       {
 9           a[++en]=n%m;
10           n/=m;
11       }
12     for(int i=en;i>0;i--)
13       {
14           if(a[i]<10) printf("%d",a[i]);
15           else putchar(a[i]-10+'A');
16       }
17     puts("");
18     return 0;
19 }

 

相关文章:

  • 2021-09-29
  • 2021-04-13
  • 2021-06-03
  • 2021-10-16
  • 2022-12-23
  • 2021-11-22
猜你喜欢
  • 2022-01-19
  • 2021-12-17
  • 2021-08-31
  • 2022-01-14
  • 2021-11-01
  • 2021-09-28
  • 2021-12-26
相关资源
相似解决方案