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 32 33 | #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> #define WORDS 5 int main(void) { int i, index; char dic[WORDS][2][30] = { { "book", "Ã¥" }, { "boy", "¼Ò³â" }, { "computer", "ÄÄÇ»ÅÍ" }, { "language", "¾ð¾î" }, { "rain", "ºñ" }, }; 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; } | cs |