| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 123421 | 冯诚阳 | 统计特定单词数 | C++ | Wrong Answer | 0 MS | 280 KB | 889 | 2025-06-29 19:25:45 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ string a,b; getline(cin,a); getline(cin,b); int l=b.size(),c=0,x=0,s,l1=a.size(); for(int i=0;i<l;i++){ if(b[i]>='A'&&b[i]<='Z') b[i]+=32; } for(int i=0;i<l1;i++){ if(a[i]>='A'&&a[i]<='Z') a[i]+=32; } for(int i=0;i<l;i++){ if(b[i]==a[x]){ x++; if(x==l1){ x=0 ; c++; if(c==1) s=i-l1+1; } } } if(c==0) cout<<-1; else cout<<c<<" "<<s; return 0; }
------Input------
alun Alunis the best teacher of TCJY alun
------Answer-----
1 32
------Your output-----
2 0