L1-059 敲笨钟 (20分)

    科技2024-12-04  17

    L1-059 敲笨钟 (20分)

    #include <bits/stdc++.h> #define int ll //#pragma GCC optimize(2) 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() { //ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); int _ = 1; cin >> _; getchar(); while (_--) { solve(); } return 0; }
    Processed: 0.015, SQL: 8