2 solutions

  • 0
    @ 2026-4-1 9:31:52

    #include <bits/stdc++.h> using namespace std; int main() { int n,x; cin>>n>>x; string s; while(n) { int ge=n%x; if(ge<10) { s=s+char('0'+ge); } else { s=s+char('A'+ge-10); } n/=x; } reverse(s.begin(),s.end()); cout<<s; return 0; }

    Information

    ID
    1195
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    (None)
    # Submissions
    50
    Accepted
    18
    Uploaded By