#include
#include
int main()
{
int a,b;
b = 0;
while ( (a = getchar()) != EOF)
{
if ( a == ' ')
{
if (b == 0)
{
b =1;
putchar(a);
};
};
if ( a != ' ')
{
b = 0;
putchar (a);
};
};
system("pause");
return 0;
}
我想问的是:
if (b == 0)
{
b =1;
putchar(a);
};
这段if语句中运行到b = 1 时这段if语句会退出吗?
此题来自the c programming language 第二版中exercise 1-9 wirte a program to copy its input to its output ,replacting each string of one or more blanks by a single blank.刚学
谢谢各位了