|
|
|
@ -8,7 +8,7 @@ struct word
|
|
|
|
|
{
|
|
|
|
|
char chinese[100];
|
|
|
|
|
char english[100];
|
|
|
|
|
char mean[100];
|
|
|
|
|
char liju[100];
|
|
|
|
|
char shuxing[100];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -36,7 +36,7 @@ void fileclose(FILE *fp)//
|
|
|
|
|
void shoucan(word temp)//收藏的单词
|
|
|
|
|
{
|
|
|
|
|
FP=fileopen(shoucanjia);
|
|
|
|
|
printf("%s %s %s %s ",temp.english,temp.chinese,temp.mean,temp.shuxing);
|
|
|
|
|
printf("%s %s %s %s ",temp.english,temp.chinese,temp.liju,temp.shuxing);
|
|
|
|
|
fwrite(&temp,sizeof(temp),1,FP);
|
|
|
|
|
fileclose(FP);
|
|
|
|
|
|
|
|
|
@ -57,12 +57,16 @@ void findlike()//
|
|
|
|
|
word temp;
|
|
|
|
|
int n=0,i=0;
|
|
|
|
|
printf("PLEAES INPUT ENGLISH:");
|
|
|
|
|
printf("输入单词:");
|
|
|
|
|
printf("退格:退后一个单词\n");
|
|
|
|
|
printf("输入:");
|
|
|
|
|
|
|
|
|
|
printf("退格:查看收藏夹内单词\n");
|
|
|
|
|
while(1)
|
|
|
|
|
{
|
|
|
|
|
int n=0;
|
|
|
|
|
printf("\n\n\n返回上一级按空格键 ");
|
|
|
|
|
if(i==0)
|
|
|
|
|
printf("退格:查看所有单词");
|
|
|
|
|
else
|
|
|
|
|
printf("退格:退后一个单词");
|
|
|
|
|
char c=getch();
|
|
|
|
|
system("cls");
|
|
|
|
@ -96,7 +100,7 @@ void findlike()//
|
|
|
|
|
|
|
|
|
|
if(strcmp(temp.english,tempenglish)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.mean,temp.shuxing);
|
|
|
|
|
printf("\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.liju,temp.shuxing);
|
|
|
|
|
n=0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -108,7 +112,7 @@ void findlike()//
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.mean,temp.shuxing);
|
|
|
|
|
printf("\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.liju,temp.shuxing);
|
|
|
|
|
n=1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -135,6 +139,9 @@ void change()//
|
|
|
|
|
{
|
|
|
|
|
n=1;
|
|
|
|
|
printf("\n\n\n返回上一级按空格键 ");
|
|
|
|
|
if(i==0)
|
|
|
|
|
printf("退格:查看所有单词");
|
|
|
|
|
else
|
|
|
|
|
printf("退格:退后一个单词");
|
|
|
|
|
char c=getch();
|
|
|
|
|
stop: system("cls");
|
|
|
|
@ -173,7 +180,7 @@ void change()//
|
|
|
|
|
|
|
|
|
|
if(strcmp(temp.english,tempenglish)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.mean,temp.shuxing);
|
|
|
|
|
printf("\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.liju,temp.shuxing);
|
|
|
|
|
printf("\n-------按1收藏");
|
|
|
|
|
printf("\n-------按0修改");
|
|
|
|
|
printf("\n-------按其他键继续查找");
|
|
|
|
@ -186,16 +193,17 @@ void change()//
|
|
|
|
|
else if(c==48)//修改单词
|
|
|
|
|
{
|
|
|
|
|
// printf("%d",sizeof(word));
|
|
|
|
|
// printf("%s %s %s %s ",temp.english,temp.chinese,temp.mean,temp.shuxing);
|
|
|
|
|
// printf("%s %s %s %s ",temp.english,temp.chinese,temp.liju,temp.shuxing);
|
|
|
|
|
printf("\n修改后的英文:");
|
|
|
|
|
scanf("%s",temp.english);
|
|
|
|
|
printf("修改后的意思:");
|
|
|
|
|
scanf("%s",temp.chinese);
|
|
|
|
|
printf("例子:");
|
|
|
|
|
scanf("%s",temp.mean);
|
|
|
|
|
printf("属性:");
|
|
|
|
|
scanf("%s",temp.shuxing);
|
|
|
|
|
printf("%s %s %s %s ",temp.english,temp.chinese,temp.mean,temp.shuxing);
|
|
|
|
|
printf("例子:");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
gets(temp.liju);
|
|
|
|
|
printf("%s %s %s %s ",temp.english,temp.chinese,temp.liju,temp.shuxing);
|
|
|
|
|
// printf("%d",sizeof(word));
|
|
|
|
|
// printf("%d",sizeof(temp));
|
|
|
|
|
fseek(fp,-sizeof(word),SEEK_CUR);
|
|
|
|
@ -220,7 +228,7 @@ void change()//
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
printf("\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.mean,temp.shuxing);
|
|
|
|
|
printf("\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.liju,temp.shuxing);
|
|
|
|
|
n=1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -245,10 +253,11 @@ stop: printf("\n");
|
|
|
|
|
scanf("%s",temp.english);
|
|
|
|
|
printf("此单词的中文:");
|
|
|
|
|
scanf("%s",temp.chinese);
|
|
|
|
|
printf("例句:");
|
|
|
|
|
scanf("%s",temp.mean);
|
|
|
|
|
printf("属性:");
|
|
|
|
|
scanf("%s",temp.shuxing);
|
|
|
|
|
printf("例句:");
|
|
|
|
|
fflush(stdin);
|
|
|
|
|
gets(temp.liju);
|
|
|
|
|
fwrite(&temp,sizeof(temp),1,FP);
|
|
|
|
|
printf("添加成功!!!!!");
|
|
|
|
|
fileclose(FP);
|
|
|
|
|