Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define IN 1
- #define OUT 0
- main()
- {
- int c, i, j, cwlen, state;
- int wlen[15];
- state = OUT;
- for (i = 0; i < 15; ++i)
- wlen[i] = 0;
- while ((c = getchar()) != EOF)
- if (c != ' ' && c != '\t' && c != '\n') {
- ++cwlen;
- state = IN;
- } else if (state = IN) {
- ++wlen[cwlen];
- cwlen = 0;
- state = OUT;
- }
- for (i = 1; i < 15; ++i) {
- for (j = 1; j <= wlen[i]; ++j)
- putchar('|');
- putchar('\n');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement