#include <bits/stdc++.h>
using namespace std;





int main()
{
    int n,m;
    cin >> n >> m;
    char s[17] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
    string str = "";
    int i;
    while(n)
    {
        i = n%m;
        n = n/m;
        str = s[i] + str;
    }
    cout << str;


    return 0;
}

第一:奇葩的万能头文件

第二:char中只能用单引号

第三:itoa不是在所有编译器中都能用

相关文章:

  • 2022-12-23
  • 2022-02-24
  • 2022-12-23
  • 2022-01-19
  • 2021-08-31
  • 2022-03-03
  • 2021-11-20
  • 2022-02-04
猜你喜欢
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-23
  • 2022-12-23
相关资源
相似解决方案