题解 | #进制转换#
进制转换
https://www.nowcoder.com/practice/deb19498bc644f53a6a99905ef5ee01d
#include <iostream> using namespace std; int main() { string str; while(cin>>str){ int res=0; for(int i=2;i<str.size();i++){ if(str[i]>='0'&&str[i]<='9')res=16*res+str[i]-'0'; else res=16*res+str[i]-'A'+10; } cout<<res<<endl; } }