80分 蒟蒻求调QAQ
查看原帖
80分 蒟蒻求调QAQ
983534
lirenzehao楼主2023/11/19 21:08

代码感觉没问题啊,为什么两个WA? T_T

record

80分提交记录

code

#include<bits/stdc++.h>
using namespace std;
int x,m;
string s;
void f(){
	while(x!=0){
		int y=x%m;
		if(y>10){
			s=char(y%10+'A')+s;
		}
		else{
			s=char(y+'0')+s;
		}
		x/=m;
	}
} 
int main(){
	cin>>x>>m;
	f();
	cout<<s;
}
2023/11/19 21:08
加载中...