Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
1051 曾浩森 进制转换2 C++ Runtime Error 1 MS 320 KB 705 2023-07-01 14:21:44

Tests(0/1):


Code:

#include<iostream> using namespace std; string x(int a,int b){ int x,i=0; string s; char c; while(a!=0){ x=a%b; if(x>=0&&x<=9){ c=x+48; } else c=65+x-10; s=c+s; a=a/b; } if(s=="") return 0; else return s; } string b(int a,int b){ int x,i=0,n; string s; char c; while(n!=0){ x=n%b; c=x+48; s=c+s; n=n/b;} if(s=="") return 0; else return s; } int main(){ int a,m,n; string s; cin>>m>>n; cin>>a; s=b(a,10); cout<<x(a,n); }


Run Info:

terminate called after throwing an instance of '