1 solutions

  • 0
    @ 2026-7-9 15:54:09
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int N,R;
        cin>>N>>R;
        string ans;
        while(N>0){
            int n=N%R;
            char c;
            if(n < 10) c=n +'0';
            else c=n-10+'A';
            ans+=c;
            N/=R;
        }
        reverse(ans.begin(), ans.end());
        cout << ans;
        return 0;
    }
    

    Information

    ID
    1160
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    # Submissions
    30
    Accepted
    13
    Uploaded By