20자 이하의 100개 이하의 단어로 구성 된 한영사전을 만들기

  자료 구조 : 같은 index는 같은 의미 

char english[SIZE][20] = {"pineapple", "banana", "apple", "tomato", "pear"};

  char korean[SIZE][20] = {"파인애플","바나나"," 사과","토마토","배"}; int count // 총 입력된 단어수

  기능 : 명령어에 따른 동작

  s : 검색( search) 기능으로 영어를 치면 한글이 출력

  a : 추가(add) 기능으로 새로운 영어와 한글 단어를 추가함

  q : 종료(quit) 프로그램 종료 예시 s 영어 검색 단어 : apple


  한글 단어 출력 : 사과 a 영어 단어 입력 : orange

  한글 단어 입력 : 오렌지

  s  영어 검색 단어 : orange 한글 단어 출력 : 오렌지

  q  프로그램을 종료 합니다.

이거해야하는데 기능추가하는걸 못하겠어요.

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

#include <string.h>

#define WORDS 100

int main()

{

int i, index;

char dic[WORDS][2][20] =

{

{"pineapple","파인애플"},

{"banana","바나나"},

{"apple","사과"},

{"tomato","토마토"},

{"pear","배"},

};

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");


}