Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- long blanks, tabs, newlines = 0L;
- int c;
- while ((c = getchar()) != EOF) {
- if (c == ' ')
- blanks++;
- else if (c == '\t')
- tabs++;
- else if (c == '\n')
- newlines++;
- }
- printf("Blanks: %d, tabs: %d, newlines: %d.\n", blanks, tabs, newlines);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement