这道题为什么没人提交呀
给你们看一下我的全(W)对(A)
代码:
#include <iostream>
#include <string>
using namespace std;
int main() {
int N;
string S, T;
cin >> N >> S >> T;
int count = 0;
int lenT = T.length();
while (true) {
size_t pos = S.find(T);
if (pos == string::npos) {
break;
}
S.erase(pos, lenT);
count++;
}
cout << count << endl;
return 0;
}
为什么全(bu)对(dui)呀