getogrand's blog
게토클로버
getogrand's blog
 
전체
English
Hacking
Programming
Database
Hardware
OS
Others
Network
Mobile
My Life
     
«   2012/05   »
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
 
     
2012/03 - 1
2012/02 - 1
2012/01 - 1
2011/11 - 1
2011/10 - 1
  

Total 297650, yesterday 21, today 12
powered by Tatter tools, designed by kokoro studio.
Q. 한 문장을 입력받아 단어의 개수를 세는 프로그램을 작성하시오.
#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);
}

크리에이티브 커먼즈 라이센스
Creative Commons License
2010/05/13 01:45 2010/05/13 01:45
   이 글에는 트랙백을 보낼 수 없습니다
*1  ... *27  *28  *29  *30  *31  *32  *33  *34  *35  ... *81