1 #include <stdio.h>
 2 #define IN  1
 3 #define OUT 0
 4 
 5 int main()
 6 {
 7     int c, state;
 8     state = OUT;
 9 
10     while( (c = getchar()) != EOF)
11 
12     {
13         if(c == ' ' || c == '\n' || c == '\t')
14         {
15             if(state == IN)
16             {
17                 putchar('\n');
18                 state = OUT;
19               }
20          }
21         else if (state == OUT)
22         {
23             state = IN;
24             putchar(c);
25         }
26         else
27        putchar(c);
28 
29     }
30 }                           

 

posted on 2020-04-24 11:06  杪杪  阅读(427)  评论(0)    收藏  举报