以下是引用lz1091914999在2011-6-8 17:24:22的发言:
#include
#include
int main(void) {
int ch, count = 0, i = 0, j = 0;
while((ch = getchar()) != '\n')
isalpha(ch) ? (j++ || count++, putchar(ch), i = 0) : (i++ || putchar(' '), j = 0);
printf("\nYou're entered %d words\n", count);
return 0;
}
很强悍啊!不 过 我用VC6编译出错,请问你用什么编译的
#include
#include
int main(void) {
int ch, count = 0, i = 0, j = 0;
while((ch = getchar()) != '\n')
isalpha(ch) ? (j++ || count++, putchar(ch), i = 0) : (i++ || putchar(' '), j = 0);
printf("\nYou're entered %d words\n", count);
return 0;
}
亲爱的朋友们动起手来吧,让我们一起迈向C语言的世界!