书也会误导人
提示: 作者被禁止或删除 内容自动屏蔽
2008-09-20 14:06
程序代码:
#include <stdio.h>
#include <ctype.h>
#include <stdbool.h>
#define S '|'
int main(void)
{
char c;
int n = 1;
bool has_word = false;
while ((c = getchar()) != S)
{
if (!isspace(c) && !has_word) /*x为假,!x为真*/
has_word = true;
n++;
}
printf("%d", n);
return 0;
}
2008-09-20 14:57
2008-09-20 15:19