#include <stdio.h>

int main()
{
    int spa = 0,lin = 0,tab = 0;
    int c;
    /* spa代表空格个数,tab代表制表符个数,lin代表换行符个数 */

    while((c = getchar()) != EOF)
    {
       if(c == ' ')
       {
           spa++;
       }
       else if(c == '\t')
       {
           tab++;
       }
       else if(c == '\n')
       {
           lin++;
       }
    }

    printf("%d  %d  %d\n",spa,tab,lin);
    return 0;
}



统计换行数,空格数,tab数。

 

相关文章:

  • 2022-02-24
  • 2021-10-03
  • 2022-02-12
  • 2021-08-13
  • 2021-11-12
  • 2021-11-10
  • 2022-02-24
  • 2021-07-09
猜你喜欢
  • 2021-11-14
  • 2022-12-23
  • 2021-05-19
  • 2021-12-25
  • 2022-12-23
  • 2021-12-01
  • 2021-10-08
相关资源
相似解决方案