题解 | #进制转换#
进制转换
https://www.nowcoder.com/practice/8f3df50d2b9043208c5eed283d1d4da6
#include <cmath> #include <cstdio> #include <iostream> #include <string> using namespace std; char getresult(char s); int main() { string temp; int high; int low; cin>>temp; int result=0; for (int i=2; i<temp.size(); i++) { int x=(temp[i]>=65?(temp[i]-55):temp[i]-48); int y=pow(16,temp.size()-i-1); result+=x*y; } cout<<result; } // 64 位输出请用 printf("%lld")