这是通过的代码:
#include <bits/stdc++.h>
using namespace std;
map<char, int> m1 = {
{'0',0},
{'1',1},
{'2',2},
{'3',3},
{'4',4},
{'5',5},
{'6',6},
{'7',7},
{'8',8},
{'9',9},
{'A',10},
{'B',11},
{'C',12},
{'D',13},
{'E',14},
{'F',15},
};
map<int, char> m2 = {
{0,'0'},
{1,'1'},
{2,'2'},
{3,'3'},
{4,'4'},
{5,'5'},
{6,'6'},
{7,'7'},
{8,'8'},
{9,'9'},
{10,'A'},
{11,'B'},
{12,'C'},
{13,'D'},
{14,'E'},
{15,'F'},
};
int main() {
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int jz_1, jz_2;
string num_str;
cin >> jz_1 >> num_str >> jz_2;
int num = 0;
...(以下省略)
return 0;
}
但是如果把头文件换成:
#include <iostream>
#include <string.h>
#include <map>
就会编译失败...
求大佬解惑