L1-059 敲笨钟 (20分)
#include <bits/stdc++.h>
#define int ll
using namespace std;
typedef long long ll;
const int maxn=1e5+10;
string s;
void solve() {
getline(cin,s);
int f1=0,f2=0,num=0;
for (int i = 0; i < s.size(); ++i) {
if (s[i]==',')
if (s[i-3]=='o'&&s[i-2]=='n'&&s[i-1]=='g') f1=1;
if (s[i]=='.')
if (s[i-3]=='o'&&s[i-2]=='n'&&s[i-1]=='g') f2=1;
if (s[i]==' ') num++;
}
if (f1&&f2){
for (int i = 0; i < s.size(); ++i) {
if (num==2) break;
cout<<s[i];
if (s[i]==' ') num--;
}
cout<<"qiao ben zhong.";
} else{
cout << "Skipped";
}
cout << "\n";
}
signed main() {
int _ = 1;
cin >> _;
getchar();
while (_--) {
solve();
}
return 0;
}
转载请注明原文地址:https://blackberry.8miu.com/read-35084.html