3 条题解

  • 1
    @ 2023-3-20 19:28:14

    #include<bits/stdc++.h> using namespace std; int n,d; int zhan[100005],top=-1; int main() { cin>>n>>d; if(n==0) { cout<<0; } while(n>0) { zhan[++top]=n%d; n=n/d; } while(top>-1) { if(zhan[top]<10) { cout<<zhan[top]; }else { cout<<char(zhan[top]+55); } top--; } return 0; }

    • 1
      @ 2023-2-16 20:16:37

      #include<bits/stdc++.h>

      using namespace std;

      int n,d;

      int zhan[100005],top=-1;

      int main()

      {

      cin>>n>>d;

      if(n==0)

      {

      cout<<0;
      

      } while(n>0) { zhan[++top]=n%d; n=n/d; } while(top>-1) { if(zhan[top]<10) { cout<<zhan[top]; } else { cout<<char(zhan[top]+55); } top--; } return 0; }

      • 0
        @ 2023-2-16 21:25:40
        #include<bits/stdc++.h>
        using namespace std;
        int n,d;
        int zhan[100005],top=-1;
        int main() {
        cin>>n>>d;
        if(n==0){
        cout<<0;}while(n>0) ;zhan[++top]=n%d;n=n/d;}
        while(top>-1){
        if(zhan[top]<10){
        cout<<zhan[top];
        }
        else{
        cout<<char(zhan[top]+55);
        }
        top--;
        }
        return 0;
        }
        
        • 1

        信息

        ID
        412
        时间
        1000ms
        内存
        16MiB
        难度
        7
        标签
        递交数
        90
        已通过
        20
        上传者