字符串單詞數(shù).c
#include<stdio.h>#define BUFFERSIZE 1024 int main(){ char string[BUFFERSIZE]; int i,count=0,word=0; char c; gets(string) ; for(i=0;(c=string[i])!='/0';i++) { if(c==' ') word=0; else if(word==0) { word=1; count++; } } printf("%d /n",count);}
以上所述就是本文的全部?jī)?nèi)容,希望大家能夠喜歡。
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注