| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 152717 | 冯诚阳 | 统计特定单词数 | C++ | Wrong Answer | 1 MS | 276 KB | 827 | 2026-05-01 18:41:22 |
#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 cnt=0,pos1=-1; size_t pos=0; for(int i=0;a[i]!='\0';i++) if(a[i]>='A'&&a[i]<='Z') a[i]+=32; for(int i=0;b[i]!='\0';i++) if(b[i]>='A'&&b[i]<='Z') b[i]+=32; while(b.find(a,pos)!=string::npos){ pos=b.find(a,pos); if(pos1==-1){ pos1=b.find(a,pos); } cnt++; pos+=a.size(); } if(pos1!=-1) cout<<cnt<<" "<<pos1<<endl; else cout<<-1; return 0; }
------Input------
alun Alunis the best teacher of TCJY alun
------Answer-----
1 32
------Your output-----
2 0