#include <iostream>
#include <map>
#include <string>
#include <math.h>
using namespace std;
int main()
{
cin.tie(0),cin.sync_with_stdio(0);
map<char , int> m;
m['0'] = 0;
m['1'] = 1;
m['2'] = 2;
m['3'] = 3;
m['4'] = 4;
m['5'] = 5;
m['6'] = 6;
m['7'] = 7;
m['8'] = 8;
m['9'] = 9;
m['A'] = 10;
m['B'] = 11;
m['C'] = 12;
m['D'] = 13;
m['E'] = 14;
m['F'] = 15;
cout<<"十六進位表示法 相對應的十進位表示法\n";
for(int i = 0 ; i < 2 ; i++){
int count = 0;
string s;
cin >> s;
count += (m[s[1]] * pow(16 , 0) + m[s[0]] * pow(16 , 1));
cout <<" "<< s <<" "<< count<<"\n";
}
cout<<"\n";
return 0;
}
for(int i = 0 ; i < 2 ; i++){
因為你只吃了兩筆測資,題目沒有說只有兩筆
for(int i = 0 ; i < 2 ; i++){因為你只吃了兩筆測資,題目沒有說只有兩筆
那我該怎麼改呢
看你a022: 迴文有過,就用相同的方式輸入至 s 即可