Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
115134 冯诚阳 统计特定单词数 C++ Wrong Answer 0 MS 276 KB 947 2025-03-29 14:57:55

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; int la,lb; getline(cin,a); getline(cin,b); la=a.size(); lb=b.size(); int j=0,c=0,d; for(int i=0;i<la;i++){ if(a[i]>='A'&&a[i]<='Z') a[i]+=32; } for(int i=0;i<lb;i++){ if(b[i]>='A'&&b[i]<='Z') b[i]+=32; } for(int i=0;i<lb;i++){ if(a[j]==b[i]){ j++; if(j==la){ c++; if(c==1){ d=i-(la-1); } j=0; } } else{ j=0; } } if(c==0) cout<<-1; else cout<<c<<" "<<d; return 0; }


Run Info:

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