Advertisement
Guest User

Untitled

a guest
Dec 21st, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1.   1 #include<stdio.h>
  2.   2 int main()
  3.   3 {
  4.   4         int spase = 0;
  5.   5         int tab = 0;
  6.   6         int string = 0;
  7.   7         int c;
  8.   8         while ((c = getchar()) != EOF)
  9.   9         {
  10.  10                 if (c == 32)
  11.  11                         ++spase;
  12.  12                 if (c == '\t')
  13.  13                         ++tab;
  14.  14                 if (c == '\n')
  15.  15                         ++string;
  16.  16                 printf ("%d\n", c);
  17.  17         }
  18.  18         printf ("%d\n", spase);
  19.  19         printf ("%d\n", tab);
  20.  20         printf ("%d\n", string);
  21.  21 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement