```
#include<stdio.h>
#include<string.h>
#include<ctype.h>
char a[12],b[1000002];
int i,j,l1,l2,t,r,c,o;
int main()
{
fgets(a,12,stdin);
fgets(b,1000002,stdin);
l1=strlen(a)-1;
l2=strlen(b)-1;
for(i=0;i<l1;i++) a[i]=toupper(a[i]);
for(i=0;i<l2;i++)
{
if(b[i]!=' ') b[i]=toupper(b[i]);
}
for(i=0;i<l2;i++)
{
if(b[i]==' '||i==l2-1)
{
if(t!=l1)
{
t=0;
continue;
}
else
{
for(j=i-t;j<=i;j++)
{
if(b[j]==a[j]) r++;
if(r==l1) c++;
if(c==1) o=i-t;
}
t=0;
r=0;
}
}
else t++;
}
if(c==0) printf("-1");
else printf("%d %d",c,o);
return 0;
}
```
by 魏大杰 @ 2018-07-08 17:27:46
刚刚发错了
by 魏大杰 @ 2018-07-08 17:28:10
@[魏大杰](/space/show?uid=110578) 看不懂 ,,能解释一下你的思路吗
by liuzeyu12a @ 2018-07-10 23:18:36