打表题。
直接把题目描述中的头文件列表复制下来并存到一个 map
中调用即可。
#include<map>
#include<cstdio>
#include<iostream>
std::map<std::string, bool>map;
int main(){
map["algorithm"] = map["bitset"] = map["cctype"] = map["cerrno"] = map["clocale"] = map["cmath"] = map["complex"] = map["cstdio"] = map["cstdlib"] = map["cstring"] = map["ctime"] = map["deque"] = map["exception"] = map["fstream"] = map["functional"] = map["limits"] = map["list"] = map["map"] = map["iomanip"] = map["ios"] = map["iosfwd"] = map["iostream"] = map["istream"] = map["ostream"] = map["queue"] = map["set"] = map["sstream"] = map["stack"] = map["stdexcept"] = map["streambuf"] = map["string"] = map["utility"] = map["vector"] = map["cwchar"] = map["cwctype"] = 1;
std::ios::sync_with_stdio(false);
int T; std::cin >> T;
while (T--) {
std::string s; std::cin >> s;
if (map.count(s))
std::cout << "Qian\n";
else
std::cout << "Kun\n";
}
}