#include #include #include #define LEN sizeof(struct dic_info) struct dic_info { char English[40]; char Chinese[100]; }; struct dic_info inf[400]; void enter() { } void add() { } void Edit() { } void Delete() { int m; char a; char n[40]; printf("请输入你要删除的单词:\n"); while(1) { scanf("%s",n); for(m=0;m<400;m++) { if(strcmp(n,inf[m].English)==0) { inf[m].English=='\0'; inf[m].Chinese=='\0'; printf("删除成功!\n"); return; } } printf("无此单词\n"); printf("输入y或Y继续操作,输入其他返回菜单\n"); scanf("%c",&a); if(a=='y'||a=='Y') { Delete(); } break; } } int main(void) { int choice,i,n=1; char a,b; do { printf("\n\t =============================="); printf("\n\t *欢迎使用有限电子英汉词典*"); printf("\n\t ==============================\n"); printf("\n\t ***********菜单显示***********\n"); printf("\n\t ********【1】词条查找********\n"); printf("\n\t ********【2】词条增词********\n"); printf("\n\t ********【3】词条删除********\n"); printf("\n\t ********【4】词条修改********\n"); printf("\n\t ********【0】退出词典********\n"); printf("请选择你要进行的功能"); scanf("%d",&choice); switch(choice) { case 1:enter();break; case 2:add();break; case 3:Delete(); for(i=0;i