RE求助

B3849 [GESP样题 三级] 进制转换

sunny_pomelo @ 2024-11-30 13:44:24

#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
int n,r;
string s;
int main()
{
    cin>>n;
    while(n!=0)
    {
        int x=n%r;
        if(x<10) s+=char(x+'0');
        else s+=char(x-'A'+10);
        n/=r;
    }
    reverse(s.begin(),s.end());
    cout<<s;
}

RE是什么错误?????

点我查看


by Codenotes @ 2024-11-30 13:54:13

RE:Runtime error,运行时错误,报错浮点数异常


by sunny_pomelo @ 2024-11-30 14:30:18

@Codenotes 谢谢


|