文章
11
粉丝
20
获赞
4
访问
8.3k
#include<iostream>
using namespace std;
int main() {
string num16;
while (cin >> num16) {
unsigned long long sum = 0;
for (int i = 2; i < num16.size(); i++) {
sum *= 16;
if (num16[i] >= '0' && num16[i] <= '9') sum += num16[i] - 48;
else if (num16[i] >= 'A' && num16[i] <= 'F') sum += num16[i] - 55;
}
cout << sum << endl;
num16.clear();
}
}
登录后发布评论
暂无评论,来抢沙发