牛客 月赛 C

11 篇文章 0 订阅
6 篇文章 0 订阅
链接: 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;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值