| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 138487 | 冯诚阳 | R进制转十进制 | C++ | Accepted | 1 MS | 280 KB | 364 | 2025-11-24 20:54:31 |
#include <iostream> #include <cstring> using namespace std; int main(){ char str[64]; int r; cin>>r>>str; long long len=strlen(str),x=1,s=0,t; for(int i=len-1;i>=0;i--){ if(str[i]>='A') t=str[i]-'A'+10; else t=str[i]-'0'; s+=t*x; x*=r; } cout<<s; return 0; }