#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int MAX=1010;
char str[MAX];
int main()
{
int n,len,i,tab,trail,j,ans;
scanf("%d",&n);
getchar();
for(i=0;i<n;++i)
{
tab=0;
ans=0;
trail=0;
while(gets(str))
{
if (strcmp(str,"##") == 0)
{
break;
}
trail = 0;
len=strlen(str);
for(j=0;j<len;++j)
{
if(str[j]=='\t')
{
tab++;
trail+= 4;
continue;
}
else if(str[j]==' ')
{
trail++;
continue;
}
trail=0;
}
ans+=trail;
}
printf("%d tab(s) replaced\n", tab);
printf("%d trailing space(s) removed\n", ans);
}
return 0;
}
zoj2851
最新推荐文章于 2019-08-10 13:10:38 发布