| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 160935 | 万骏博 | 统计特定单词数 | C++ | Wrong Answer | 1 MS | 272 KB | 599 | 2026-09-26 16:59:26 |
#include<bits/stdc++.h> using namespace std; int n,m,l,b=-1; string s,c,a=""; int main(){ getline(cin,s); getline(cin,c); c+=" "; n=s.size(); m=c.size(); for(int i=0;i<n;i++){ if(s[i]>='A'&&s[i]<='Z'){ s[i]+=32; } } for(int i=0;i<m;i++){ if(c[i]!=' '){ if(c[i]>='A'&&c[i]<='Z'){ c[i]+=32; } } } for(int i=0;i<m;i++){ if(c[i]!=' '){ a=a+c[i]; } else if(a==s&&b==-1){ l++; b=i-a.size(); a=""; } else if(a==s){ l++; a=""; } else{ a=""; } } cout<<l<<" "<<b; return 0; }
------Input------
alun A lun is the best teacher of TCJY
------Answer-----
-1
------Your output-----
0 -1