-
(2021.11.14) C언어 예제 - 한영사전 구현2021년 11월/C#, C++ (2021.11) 2021. 11. 16. 09:35
#include <stdio.h> #include <string.h> #define WORDS 5 int main(void) { int i, index; char dic[WORDS][2][30] = { {"book", "책"}, {"car", "자동차"}, {"drug", "약"}, {"height", "높이"}, {"joke", "농담"} }; char word[30]; printf("단어 입력: "); scanf("%s", word); index = 0; for (i = 0; i < WORDS; i++){ if (strcmp(dic[index][0], word) == 0){ printf("%s: %s\n", word, dic[index][1]); return 0; } index++; } printf("사전에 포함되지 않은 단어\n"); return 0; }'2021년 11월 > C#, C++ (2021.11)' 카테고리의 다른 글
C언어 예제 - 벡터 연산 (0) 2021.11.16 (2021.11.15) C언어 예제 - 메세지 암호화 (0) 2021.11.16 (2021.11.13) C언어 예제 - 파일 이름 자동생성 (0) 2021.11.16 C언어 예제 - 단어 세기 (0) 2021.11.12 (2021.11.11) C언어 예제 - 거리 감지 센서 (0) 2021.11.12