80分
查看原帖
80分
1066396
szm111213楼主2024/7/9 14:13
#include <iostream>
#include <stack>
using namespace std;

int main()
{
    unsigned long long n,m;
    cin >> n >> m;
    stack<unsigned long long> s;
    while (n)
	{
        s.push(n % m);
        n /= m;
    }
    while (!s.empty())
	{
        cout << s.top();
        s.pop();
    }
    cout << endl;
    return 0;
}
2024/7/9 14:13
加载中...