Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
99024 | 唐钧 | K进制数转L进制数 | C++ | 输出超限 | 0 | 4 MS | 236 KB | 404 | 2023-08-21 16:20:55 |
#include<bits/stdc++.h> using namespace std; int p,n,q,i,j,s,a[23]; int main() { while(1) { cin>>p>>n>>q; i=1; j=1; s=0; while(n>0) { j--; a[j]=n%10; n/=10; } /*for(i=j;i<=20;i++) { s=(s*p+a[i]); }*/ j=21; while(s>0) { j--; a[j]=s%q; s=s/q; } for(i=j;i<=20;i++) { cout<<a[i]; } cout<<endl; } return 0; }