Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
160836 刘轻松 统计特定单词数 C++ Wrong Answer 1 MS 272 KB 591 2026-09-26 15:07:56

Tests(1/11):


Code:

#include<iostream> #include<cstring> using namespace std; string a,b; int main(){ getline(cin,a); getline(cin,b); int lena = a.size(),lenb = b.size(); for(int i=0;i<lena;i++){ if(a[i]>='A'&&a[i]<='Z') a[i] = a[i]+32; } for(int i=0;i<lenb;i++){ if(b[i]>='A'&&b[i]<='Z') b[i] = b[i]+32; } int first=-1; first = b.find(a); if(first==-1){ cout<<-1<<endl; return 0; } int cnt=1,k=first; while(first != -1){ b.erase(first,lena); first = -1; first = b.find(a); if(first != -1) cnt++; } cout<<cnt<<" "<<k<<endl; return 0; }


Run Info:

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