Run ID:69788
提交时间:2024-04-06 19:15:18
#include<bits/stdc++.h> using namespace std; int main(){ int a; string o; cin>>a>>o; int y=0; for(int i=0;i<o.size();i++){ if(o[i]>='0'&&o[i]<='9') y=y*a+o[i]-'0'; else y=y*a+o[i]-'A'+10; } cout<<y; return 0; }