Run ID:163061

提交时间:2026-10-24 12:40:49

#include<bits/stdc++.h> using namespace std; string s; int n,m=2,r; int main(){ cin>>r>>s; int l=s.size(); for(int i=0;i<l;i++){ if(s[i]>='A') n+=pow(r,l-i-1)*(s[i]-'A'+10); else n+=pow(r,l-i-1)*(s[i]-'0'); } cout<<n; return 0; }