Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- /* Exercise 01-12 :: Write a program that prints its input one word per line of output. */
- #define IN 1
- #define OUT 0
- main()
- {
- int c,state;
- state = OUT;
- while((c = getchar()) != EOF)
- {
- if(c == ' ')
- {
- printf("\n%c", c);
- state = OUT;
- }
- else
- {
- state = IN;
- putchar(c);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement