cpp可直接使用cin >> hex输入十六进制。若十六进制数特别长,则此题应化作大数的乘法运算将十六进制转换成十进制
#include <iostream>
using namespace std;
int main()
{
int n;
while(cin >> hex >> n)
cout << n << endl;
return 0;
}
cpp可直接使用cin >> hex输入十六进制。若十六进制数特别长,则此题应化作大数的乘法运算将十六进制转换成十进制
#include <iostream>
using namespace std;
int main()
{
int n;
while(cin >> hex >> n)
cout << n << endl;
return 0;
}