2021团体程序设计天梯赛 L1-6 吉老师的回归
思路:
字符串处理
Tip:
getline和find的应用
#include <bits/stdc++.h> using namespace std; int main() { int n, t, num = 0; string now; cin >> n >> t; getchar(); for (int i = 1; i <= n; i++) { string s; getline(cin, s); if (!(s.find("qiandao") != string::npos || s.find("easy") != string::npos)) { num++; if (num == t + 1) { now = s; break; } } } if (num < t + 1) cout << "Wo AK le" << endl; else cout << now << endl; return 0; }