题目链接

进制转换

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int maxn=1e5+5;
const int INF = 0x3fffffff;
int m,n,x; 
int arr[100];
int k=0;
vector<int> v;
vector<int> G[maxn];
int main(){
    LL num;
    while(cin>>num>>n){
        do{
            arr[k++] = num % n;
            num /= n;
        }while(num!=0);
        for(int i=k-1;i>=0;i--){
            cout<<arr[i];
        }
        cout<<endl;
    }

    return 0;
}