#include <stdio.h>
#include <conio.h>
void main(){
char str[99999];
int count=1, x;
printf("문장입력\n");
gets(str);
for(x=0;x<=99999;x++){
if((str[x]==' ')&&(str[x+1]!=' '))
count++;
}
printf("%d", count);
}
Q. 한 문장을 입력받아 단어의 개수를 세는 프로그램을 작성하시오.
이 글에는 트랙백을 보낼 수 없습니다







