提交时间:2025-05-17 14:38:24
运行 ID: 322936
#include<bits/stdc++.h> using namespace std; string s; int main(){ long long n=0,t=1,i; cin>>s; for(i=s.size()-1; i>=0; i--){ if(s[i]>='0'&&s[i]<='9'){ n=n+(s[i]-'0')*t; }else{ n=n+(s[i]-'A'+10)*t; } t=t*16; } cout<<n; return 0; }