2 solutions

  • 0
    @ 2026-8-24 15:41:50
     #include<bits/stdc++.h>
    using namespace std;
    
    int main()
    {
        int a,b;
        string s;
        cin>>a>>b;
        while(a>0)
        {
            int o=a%b;
            if(o>=10){
                s+='A'-10+o;
            }else{
                s+='0'+o;
            }
            a/=b;
        }
        reverse(s.begin(),s.end());
        cout<<s;
        return 0; 
    }
    

    CCF4302CCF4302

    Information

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