1

噢莫加纳加加加 · 发布于 2024-12-07 · 浏览 585 回复 0
#include "bits/stdc++.h"

using namespace std;
int main(){
    string s2,s1;
    getline(cin,s2);
    getline(cin,s1);
    int ans = 0;
    int x = 0;
    while (s1.find(s2,x)!=-1){
        ans++;
        x = s1.find(s2,x)+1;
    }
    cout << ans;
    return 0;
}

全部回复 共 0 条

还没有人回复。往下写第一条。

发表回复