Write a program that prints its input one word per line.

#include <stdio.h>
 
#define  State '
' 
void main()
{
    int Juge=0;/*only one space*/

    int c=0;
    while((c=getchar())!=EOF) 
    {
        if(c==' '||c=='	'||c=='')
        {
            if(Juge==1)
            {
                 putchar(State);
                 Juge=0;
            }
        }
        else
        {
            putchar(c);    
            Juge=1;
        }
    }

}
I Love U
I
Love
U
原文地址:https://www.cnblogs.com/wjshan0808/p/3329523.html