#include<stdio.h> int main() { char c; int count=0; while(scanf("%c",&c)!=EOF){ count++; if(c==' '){ count = 0; } } printf("%d",count-1); return 0; } 为什么需要count 减1?