| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 8398 | 刘逸杭 | 统计特定单词数 | C++ | Wrong Answer | 0 MS | 264 KB | 506 | 2025-11-09 09:29:08 |
#include<bits/stdc++.h> using namespace std; int main(){ string s,s1; int cnt=0; cin>>s1; cin.get(); getline(cin,s); for(int i=0;i<s.size();i++){ if(s[i]>='A'&&s[i]<='Z') s[i]+=32; if(s1[i]>='A'&&s1[i]<='Z') s1[i]+=32; } if(s.find(s1)!=s.npos){ for(int i=0;i<s.size();i++){ if(s.substr(i,s1.size()+i)==s1) cnt++; } cout<<cnt<<' '<<s.find(s1,0); return 0; } cout<<-1; return 0; }
------Input------
alun OK Alun is the best teacher of TCJY
------Answer-----
1 3
------Your output-----
0 3