Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
152715 冯诚阳 统计特定单词数 C++ Wrong Answer 1 MS 276 KB 814 2026-05-01 18:38:59

Tests(1/11):


Code:

#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 pos=0,pos1=-1,cnt=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; }


Run Info:

------Input------
alun Alunis the best teacher of TCJY alun
------Answer-----
1 32
------Your output-----
2 0