7.29打卡

发布时间 2023-07-29 22:05:05作者: 灬倾夏

L1-059 敲笨钟

#include<bits/stdc++.h>
using namespace std;
int main() {
int n,a,b;
string str;
cin >> n;
getchar();
for (int i = 0; i < n; i++) {
getline(cin,str);
if (str.find("ong,") != -1&&str.find("ong.") != -1) {
int sum=0,k=0;
for(int j=str.size()-1; sum != 3; j--)//找出倒数第三个空格的位置
{
if(str[j]==' ') sum++;
k=j;
}
for(int i = 0; i <= k; i++){
cout << str[i];
}
cout << "qiao ben zhong." << endl;
}
else cout << "Skipped" << endl;
}
return 0;
}