Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
134520 冯诚阳 统计特定单词数 C++ Wrong Answer 1 MS 276 KB 889 2025-10-27 19:47:16

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()\fabs() #include<ctime> #include<cstdlib> #include<cstring> using namespace std; int main(){ string a; getline(cin,a); string b; getline(cin,b); int w,l,c,s=0; for(int i=0;i<a.size();i++){ if(a[i]>='a' && a[i]<='z') a[i]-=32; } for(int i=0;i<b.size();i++){ if(b[i]>='a' && b[i]<='z') b[i]-=32; } w=b.find(a); if(w==-1){ cout<<w; return 0; } else{ l=a.size(); c=w; while(c!=-1){ s++; b.erase(c,l); c=b.find(a); } }cout<<s<<' '<<w; return 0; }


Run Info:

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