牛客 月赛 C

链接: 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

输入描述:

 
 
第一行一个正整数 ,表示询问个数。
接下去 行,每行一个仅由小写字母构成的字符串 ,表示一个询问。 

输出描述:

输出共  行,每行一个字符串  表示这个头文件存在,或  表示这个头文件不存在。 
 
 
#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;
}


猜你喜欢

转载自blog.csdn.net/qq_41333844/article/details/80243777