只能判断一次,不能重复判断
# include <stdio.h>
int main()
{
int c, n0 = 0;
while((c = getchar())!=EOF)
{
if(c != ' ')
putchar(c);
if(c == ' ')
{
n0++;
if(n0 <= 1)
putchar(c);
}
}
}
2024-01-25 12:18:28
只能判断一次,不能重复判断
# include <stdio.h>
int main()
{
int c, n0 = 0;
while((c = getchar())!=EOF)
{
if(c != ' ')
putchar(c);
if(c == ' ')
{
n0++;
if(n0 <= 1)
putchar(c);
}
}
}