| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 155261 | 任艺宸 | 十进制转R进制 | C++ | Runtime Error | 0 MS | 280 KB | 603 | 2026-06-06 12:18:14 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int x,r,y,i=0; char s[10001]={}; cin>>x>>r; if(x==0){ cout<<0<<endl; return 0; } while(x!=0){ y=x%r; if(y>=0&&y<=9){ s[i++]=char(y+'0'); }else{ s[i++]=char(y+'A'-10); x/=r; } }for(int j=i-1;j>=0;j--)cout<<s[j]; return 0; }
Runtime Error:Segmentation fault