Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.    
  5.     long blanks, tabs, newlines = 0L;
  6.     int c;
  7.     while ((c = getchar()) != EOF) {
  8.         if (c == ' ')
  9.             blanks++;
  10.         else if (c == '\t')
  11.             tabs++;
  12.         else if (c == '\n')
  13.             newlines++;
  14.     }
  15.    
  16.     printf("Blanks: %d, tabs: %d, newlines: %d.\n", blanks, tabs, newlines);
  17.    
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement