链接:
https://www.nowcoder.com/acm/contest/86/C
来源:牛客网
来源:牛客网
算卦先生来问你,对于每个他给出的 C++ 头文件,请告诉他是否存在。
头文件列表:algorithm, bitset, cctype, cerrno, clocale, cmath, complex, cstdio, cstdlib, cstring, ctime, deque, exception, fstream, functional, limits, list, map, iomanip, ios, iosfwd, iostream, istream, ostream, queue, set, sstream, stack, stdexcept, streambuf, string, utility, vector, cwchar, cwctype
输入描述:
第一行一个正整数
,表示询问个数。
![](https://i-blog.csdnimg.cn/blog_migrate/a41a08831cc189ba1274fb55e1bd1ed7.png)
接下去
行,每行一个仅由小写字母构成的字符串
,表示一个询问。
![](https://i-blog.csdnimg.cn/blog_migrate/a41a08831cc189ba1274fb55e1bd1ed7.png)
![](https://i-blog.csdnimg.cn/blog_migrate/e9649e855d9789ba94f13569cb296c09.png)
输出描述:
输出共 行,每行一个字符串 表示这个头文件存在,或 表示这个头文件不存在。
#include<iostream>
#include<cstring>
using namespace std;
char a[][100]={"algorithm","bitset","cctype","cerrno","clocale","cmath"
,"complex","cstdio","cstdlib","cstring","ctime","deque","exception","fstream","functional","limits",
"list","map","iomanip","ios","iosfwd","iostream",
"istream","ostream","queue","set","sstream","stack",
"stdexcept","streambuf","string","utility","vector","cwchar","cwctype"
};
int main()
{
int t,flag;
cin>>t;
char b[100];
while(t--)
{
flag=1;
cin>>b;
for(int i=0;i<35;i++)
{
if(strcmp(b,a[i])==0) {
cout<<"Qian"<<endl;
flag=0;
break;
}
}
if(flag)
cout<<"Kun"<<endl;
}
return 0;
}