求助
查看原帖
求助
1507573
feng3000楼主2025/6/15 09:31
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
    string  s;
    cin>>s;
    long long ans = 0;
    string get = "chuanzhi";
    if(s == get){
        cout<<"1"<<endl;
    }
    else{
        long long i = 0;
        long long len = get.size();
        while(i<s.size() - (len-1)){
            if(s.substr(i,len) == get){
                ans++;
            }
            i++;
        }
    }
    cout<<ans<<endl;
    return 0;
}

请求大佬相助

2025/6/15 09:31
加载中...