版本比较
You too!
正文
增加 3 行删除 3 行
6 行未改动7891011111213141515161718195 行未改动252627282929303132336 行未改动int countYoutoo(const string& str) { int count = 0; string target = "youtoo"; int targetLen = target.length();
if (str.length() < targetLen) { return 0; }
for (size_t i = 0; i <= str.length() - targetLen; i++) { if (str.substr(i, targetLen) == target) { count++; }5 行未改动 string input; cin>>input; int result = countYoutoo(input); cout << result << endl;
return 0;}
```