Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
134535 黄枳润 统计特定单词数 C++ Wrong Answer 1 MS 276 KB 707 2025-10-27 20:31:03

Tests(0/11):


Code:

#include <iostream> #include <cmath> #include <cstdio> using namespace std; long long a[1005]; int main(){ string a,b; int w,s,c,l; getline(cin,a); getline(cin,a); 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; } } a=' '+a+' '; b=' '+b+' '; w=b.find(a); if(w==-1){ cout<<w; return 0; }else{ l=a.size(); while(w!=-1){ s++; b.erase(c,l); w=b.find(a); } } cout<<s<<' '<<w; return 0; }


Run Info:

------Input------
alun is the best teacher of TCJY ALUN
------Answer-----
1 28
------Your output-----
-1