#include <stdio.h>
int main()
{
int c;
int space_count, tab_count, enter_count;
space_count = 0;
tab_count = 0;
enter_count = 0;
while ((c = getchar()) != EOF)
{
if(c == ' ')
space_count++;
else if(c == '\t')
tab_count++;
else if(c == '\n')
enter_count++;
}
printf("space_count=%d\ttab_count=%d\tenter_count=%d\t\n", space_count, tab_count, enter_count);
}
EOF ctrl+d
版权声明:本文为weixin_45948792原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。