// dgfd.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include
#include
int main(int argc, char* argv[])
{
char c;
c=getchar();
while(c!='\n')
{
printf("%c",c);
c=getchar();
if(c==' ')
{
printf("\n");
c=getchar();
}
}
printf("\n");
return 0;
}
给你改了,
#include
void main()
{
char c;
c=getchar();
while(c!='\n')
{
if(c!=' ')
printf("%c",c);
else
printf("\n");
c=getchar();
}
}
if(c==' ')
printf("\n");
else
printf("%c",c);
printf("%c",(c==32)?'\n':c);
if(c=='')
printf("\n");
else
printf("%c",c);
楼主把c改成数组会比较好操作