programming
c) c언어코딩도장 the 갯수
FaustK
2019. 1. 5. 14:46
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 | #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> int main(void) { char s1[1001] = ""; char *ptr = NULL; int nWordCnt = 0; //워드 카운트 printf("문자열을 입력하세요(알파벳만, 1000자 이하) : "); scanf("%[^\n]s", s1); ptr = strtok(s1, " .,"); while (ptr != NULL) { if (strcmp(ptr, "the") == 0) { nWordCnt++; } ptr = strtok(NULL, " .,"); } printf("the 의 워드 수는 : %d 입니다\n", nWordCnt); return 0; } | cs |
c언어 코딩도장 "the" 단어 갯수
맞는 지 모르겠다 -.-;
c언어, 파이썬을 공부할 수 있는 곳!