文章

166

粉丝

68

获赞

855

访问

61.6k

头像
good morning 题解:find
P1207
发布于2025年3月14日 10:29
阅读数 156

#include <bits/stdc++.h>
using namespace std;

int main() {
	string s;
	while(getline(cin,s)){
	    int ct=0;
	    while(s.find("good morning")!=string::npos){
	        s.erase(s.find("good morning"),12);
	        ct++;
	    }
	    cout<<ct<<endl;
	}
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发