为什么我全是TLE
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
int zfs,num,dcs,j;
num = -1;
zfs = dcs = 0;
char str[12],a;
cin >> str;
for (int j = 0; j < strlen(str); j++)
{
if (str[j] <= 'Z'&&str[j]>='A')
str[j] += 32;
}
str[strlen(str)] = '\0';
a=getchar();
a = ' ';
while (a != '\n')
{
if (a == ' ')
{
for (j = 0;a!='\n'; j++)
{
a = getchar();
if (a <= 'Z' && a >= 'A')
a += 32;
if (j == strlen(str) && (a == '\n' || a == ' '))
{
dcs++;
if (num == -1)
num = zfs;
break;
}
if (str[j] != a)
break;
}
zfs += j;
zfs++;
}
else {
a = getchar();
if (a <= 'Z' && a >= 'A')
a += 32;
zfs++;
}
}
if (num == -1)
cout << -1;
else cout << dcs << " " << num;
return 0;
}
求大佬指点!