Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
70178 | 李琥博 | R进制转十进制 | C++ | Accepted | 1 MS | 272 KB | 312 | 2024-04-13 17:55:36 |
#include<bits/stdc++.h> using namespace std; int main(){ int x; string s; cin>>x>>s; int a=0; for(int i=0;i<s.size();i++){ if(s[i]>='0'&&s[i]<='9'){ a=a*x+s[i]-'0'; }else{ a=a*x+s[i]-'A'+10; } } cout<<a; return 0; }