牛客网 牛客小白月赛2 C.真真假假-String遍历比较

时间:2021-11-25 10:05:08

C.真真假假

链接:https://www.nowcoder.com/acm/contest/86/C

这个题真的是无敌的水,但是自己写前面的string数组的时候,里面的这些头文件要用双引号(" ")括起来,敲双引号敲到手抽筋,超级暴力的写法,还被对面的瓜皮骂了一句(嫌我操作太秀。。。)

代码:

 1 //C
2 #include<iostream>
3 #include<cstdio>
4 #include<cstring>
5 #include<cmath>
6 #include<cstdlib>
7 #include<algorithm>
8 #include<queue>
9 #include<vector>
10 #include<stack>
11 using namespace std;
12 typedef long long ll;
13 const int maxn=1e5+10;
14 const double eps=1e-7;
15 string c[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"};
16 int main(){
17 int t;
18 cin>>t;
19 while(t--){
20 string s;
21 cin>>s;
22 int flag=0;
23 for(int i=0;i<100;i++){
24 if(s==c[i]){
25 flag=1;
26 cout<<"Qian"<<endl;
27 break;
28 }
29 }
30 if(flag==0)cout<<"Kun"<<endl;
31 }
32 }