【急】求一道c语言编程题答案!谢谢(在线等)

2024-12-03 15:01:02
推荐回答(2个)
回答(1):

#include
int main()
{
char c;
while((c = getchar() )!= '\n ')
{
if(c == ' ')
printf("\n");
else
printf("%c",c);
}
return 0;
}

回答(2):

#include
int main()
{
char g;
while( (g = getchar()) != '\n')
{
if(g ==' ')
putchar('\n');
else
putchar(g);
}
putchar('\n');
return 0;
}