Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define IN 1 // w slowie
- #define OUT 0 // poza słowem
- int main() {
- int c,state;
- state = OUT;
- while(c = getchar() != EOF) {
- if( c == ' ' || c == '\n' || c == '\t') {
- if(state == IN){
- putchar('\n'); // koniec slowa
- state = OUT;
- }
- } else if( state == OUT) {
- state = IN;
- putchar(c);
- } else
- putchar(c);
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement