B2143 哪不对?dalao995
#include <bits/stdc++.h>
using namespace std;
int main() {
int n = 0, x, y, len, i;
string s;
char c;
cin >> s >> y;
len = s.length();
i = 0;
while (i < len) {
c = s[i];
if (c >= '0' && c <= '9') {
x = c - '0';
} else if (c >= 'a' && c <= 'z') {
x = 'a' + 10;
} else if (c >= 'A' && c <= 'Z') {
x = c - 'a' + 10;
}
n = n * y + x;
i++;
}
cout << n;
return 0;
}