| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 147637 | 谢绍澜 | R进制转十进制 | C++ | Accepted | 1 MS | 280 KB | 535 | 2026-02-06 15:39:41 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<vector> #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; char n(char x){ if(x>=65) return 10+x-'A'; else return x-'0'; } int main(){ int r,sum=0,s=1; string a; cin>>r>>a; for(int i=a.size()-1;i>=0;i--){ sum+=(n(a[i]))*s; s*=r; } cout<<sum; return 0; }