This previous game problem, today brush water problem saw again, at that time to see a large pile also did not see, now looked and see, I go, just do not understand what to do .... Really helpless, read someone else's code, DAWU: The original special is to ask for space and ' \ t ' quantity ah. Write the code, that is, the special is not the correct output ... Look at others code, two continue really puzzling, and then read the question, check the meaning of trailing spaces: I go, is special "trailing space" Ah ... Do not understand the problem, but also make a bird ah ....
#include <stdio.h>
#include <string.h>
int main ()
{
int n,num1,num2,i,len,k;
Char a[200000];
scanf ("%d", &n);
GetChar ();
while (n--)
{
num1=num2=0;
while (gets (a), strcmp (A, "# #")!=0)
{
Len=strlen (a);
for (i=k=0;i<len;i++)
{
if (a[i]== ' \ t ')
{
k+=4;
num2++;
Continue;
}
if (a[i]== ')
{
k++;
Continue;
}
k=0;
}
num1+=k;
}
printf ("%d tab (s) replaced\n%d trailing space (s) removed\n", num2,num1);
}
return 0;
}