reverse依旧权威
2026-06-01 09:03:19
发布于:江苏
19阅读
0回复
0点赞
依旧死判断
#include<bits/stdc++.h>
using namespace std;
char f(int n){
if(n==10) return 'A';
if(n==11) return 'B';
if(n==12) return 'C';
if(n==13) return 'D';
if(n==14) return 'E';
if(n==16) return 'F';
else return char(n+48);
}
int main(){
int x,n;
string s;
cin>>x>>n;
while(n!=0){
s+=f(n%x);
n/=x;
}
reverse(s.begin(),s.end());
cout<<s;
return 0;
}
这里空空如也







有帮助,赞一个