Run ID:3544

提交时间:2024-06-15 11:39:57

# include<iostream> using namespace std; string a, b, sts; int f=-1, cnt=0; int main(){ getline(cin, a); getline(cin, b); int cnt = 0, s1 = a.size(), s2 = b.size(); for(int i = 0; i < s1; i++)if(64<a[i]&&a[i]<97)a[i]+=32; for(int i = 0; i < s2; i++)if(64<b[i]&&b[i]<97)b[i]+=32; for(int i = 0; i < s2-1; i++){ sts = ""; for(int k = i; b[k] > 32; k++)sts += b[k]; if(sts==a){cnt++;if(f==-1)f=i;} i += sts.size(); } if(f==-1)cout<<-1; else cout<<cnt<<" "<<f; return 0; }