Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
118435 彭士宝 数单词 C++ Accepted 1 MS 276 KB 451 2025-05-01 22:38:06

Tests(4/4):


Code:

#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { string input; getline(cin, input); transform(input.begin(), input.end(), input.begin(), ::tolower); string target = "lanqiao"; int count = 0; size_t pos = 0; while ((pos = input.find(target, pos)) != string::npos) { count++; pos += target.length(); } cout << count << endl; return 0; }