为什么是N4N???
查看原帖
为什么是N4N???
821723
yyds_ty楼主2024/9/20 21:53

为什么我是输出N4N???

#include<iostream>
#include<string>
using namespace std;
int main(){
    int n,m;
    cin>>n>>m;
    string s1="";
	string s2="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    while(n!=0){
    	int x=n%m;
    	s1+=s2[x]+s1;
    	n/=m;
	}
	cout<<s1;
	return 0;
}

有没有大神帮本蒟蒻调一下???

2024/9/20 21:53
加载中...