#include<bits/stdc++.h>
using namespace std;
int main ()
{
int c1 = 0,c2 = 0,n,m;
string s;
cin>>n>>m;
getline(cin,s);//用于消除输入结束后的 换行符 或者用 getchar();
for(int i = 0;i<n;i++)
{
getline(cin,s);
if(s.find("qiandao")!=s.npos||s.find("easy")!=s.npos) c1++;
else c2++;
if(c2>m) break;
}
if(c2<=m) cout<<"Wo AK le"<<endl;
else cout<<s<<endl;
return 0;
}
```备注:getline(cin,s)用于接收一个字符串,可以接收空格并输出
s.find("qiandao")!=s.npos||s.find("easy")!=s.npos 常用的字符串查找函数
2021天梯赛 L1-6
最新推荐文章于 2021-06-11 00:46:09 发布