| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 70158 | 李琥博 | 十进制转R进制 | C++ | Wrong Answer | 1 MS | 260 KB | 381 | 2024-04-13 17:28:47 |
#include<bits/stdc++.h> using namespace std; char s[105]; int main(){ int n,r,o,i=0; cin>>n>>r; if(n<0){ cout<<"-"; n=-n; } while(n!=0){ o=n%r; n=n/r; if(o<=9){ s[i++]=o+'0'; }else{ s[i++]='A'+o-10; } } for(int j=0;j<n;j++){ cout<<s[n-1-i]; } return 0; }
------Input------
1000 8
------Answer-----
1750
------Your output-----