diff --git a/修改.c b/修改.c new file mode 100644 index 0000000..5b01624 --- /dev/null +++ b/修改.c @@ -0,0 +1,90 @@ +#include +struct dic_info +{ + char English[40]; + char Chinese[100]; +}; +struct dic_info inf[400]; +void enter() +{ +} +void add() +{ +} +void Delete() +{ +} +void Edit() +{ + int a; + int i; + char n[40]; + printf("ÇëÊäÈëÒªÐ޸ĵĵ¥´Ê£º"); + while(1) + { + scanf("%s",n); + for(i=0;i<400;i++) + { + if(strcmp(n,inf[i].English)==0) + { + printf("ÇëÊäÈëÒªÐ޸ĵÄÄÚÈÝ£º\n"); + do + { + printf("1.Ð޸ĵ¥´Ê\n"); + printf("2.ÐÞ¸ÄÊÍÒå\n"); + printf("0.·ÅÆúÐÞ¸Ä\n"); + scanf("%d",&a) ; + switch(a) + { + case 1:printf("ÇëÊäÈëÐ޸ĺóµÄµ¥´Ê£º");scanf("%s",&inf[i].English);break; + case 2:printf("ÇëÊäÈëÐ޸ĺóµÄÊÍÒ壺");scanf("%s",&inf[i].Chinese);break; + } + }while(a!=0); + } + } + printf("Î޴˵¥´Ê\n") ; + printf("ÊäÈëy»òY¼ÌÐø²Ù×÷£¬ÊäÈëÆäËû·µ»Ø²Ëµ¥\n"); + scanf("%c",&a); + if(a=='y'||a=='Y') + { + Edit(); + } + 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();break; + case 4:Edit(); + scanf("%c",&a); + for(i=0;i