贴代码
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
string tosmall(string s){
int len=s.size();
for(int i=0;i<len;i++){
if(s[i]>='A'&&s[i]<='Z')
s[i]=s[i]-'A'+'a';
}
return s;
}
int main(){
string aim;
string l;
cin>>aim;
aim=tosmall(aim);
bool f=0;
int i=0;
int sum=0,first=0;
while(cin>>l){
l=tosmall(l);
if(l==aim){
sum++;
if(!f){
f=1;
first=i;
}
}
i+=l.size();
}
if(f){
cout<<sum<<" "<<first;
}
else
cout<<-1;
return 0;
}