first commit

master
Your Name 6 years ago
parent 6092b096a2
commit 271a0a7c82

@ -8,7 +8,7 @@ struct word
{
char chinese[100];
char english[100];
char liju[100];
char mean[100];
char shuxing[100];
};
@ -36,7 +36,8 @@ void fileclose(FILE *fp)//
void shoucan(word temp)//收藏的单词
{
FP=fileopen(shoucanjia);
printf("%s %s %s %s ",temp.english,temp.chinese,temp.liju,temp.shuxing);
printf("\n%s %s %s %s ",temp.english,temp.chinese,temp.mean,temp.shuxing);
printf("收藏成功!!!");
fwrite(&temp,sizeof(temp),1,FP);
fileclose(FP);
@ -57,16 +58,13 @@ void findlike()//
word temp;
int n=0,i=0;
printf("PLEAES INPUT ENGLISH:");
printf("输入:");
printf("退格:查看收藏夹内单词\n");
printf("输入单词:");
printf("退格:退格查看所有单词\n");
while(1)
{
int n=0;
int m=0;
printf("\n\n\n返回上一级按空格键 ");
if(i==0)
printf("退格:查看所有单词");
else
if(i!=0)
printf("退格:退后一个单词");
char c=getch();
system("cls");
@ -100,7 +98,7 @@ void findlike()//
if(strcmp(temp.english,tempenglish)==0)
{
printf("\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.liju,temp.shuxing);
printf("\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.mean,temp.shuxing);
n=0;
}
else
@ -112,13 +110,13 @@ void findlike()//
}
else
{
printf("\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.liju,temp.shuxing);
n=1;
printf("\n你要查找的可能是:\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.mean,temp.shuxing);
m=1;
}
}
}
fileclose(fp);
if(n==2)
if(n==2&&m==0)
printf("\nno this");
}
fileclose(fp);
@ -132,24 +130,22 @@ void change()//
tempenglish[z]=0;
char *res;
word temp;
int n=0,i=0;
int n=0,i=0,m=0;
printf(" 输入单词:");
// printf("退格查看所有单词。");
printf("退格查看所有单词。");
while(1)
{
n=1;
m=0;
printf("\n\n\n返回上一级按空格键 ");
if(i==0)
printf("退格:查看所有单词");
else
if(i!=0)
printf("退格:退后一个单词");
char c=getch();
stop: system("cls");
if(c==49)
{
shoucan(temp);//收藏单词;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
break;
}
// if(c==49)
// {
// shoucan(temp);//收藏单词;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// break;
// }
if(c==32)
break;
printf(" 输入单词:");
@ -175,16 +171,13 @@ void change()//
}
while(fread(&temp,sizeof(word),1,fp))
{n=1;
{
if(strcmp(temp.english,tempenglish)==0)
{
printf("\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.liju,temp.shuxing);
printf("\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.mean,temp.shuxing);
printf("\n-------按1收藏");
printf("\n-------按0修改");
printf("\n-------按其他键继续查找");
n=1;
c=getch();
if(c==49)
{
@ -193,17 +186,16 @@ void change()//
else if(c==48)//修改单词
{
// printf("%d",sizeof(word));
// printf("%s %s %s %s ",temp.english,temp.chinese,temp.liju,temp.shuxing);
// printf("%s %s %s %s ",temp.english,temp.chinese,temp.mean,temp.shuxing);
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);
printf("%s %s %s %s ",temp.english,temp.chinese,temp.liju,temp.shuxing);
printf("%s %s %s %s ",temp.english,temp.chinese,temp.mean,temp.shuxing);
// printf("%d",sizeof(word));
// printf("%d",sizeof(temp));
fseek(fp,-sizeof(word),SEEK_CUR);
@ -215,27 +207,25 @@ void change()//
}
else
goto stop;
n=0;
}
else
{
char *res = strstr(temp.english,tempenglish);
if(res == NULL)
if(res != NULL)
{
n=2;
printf("\n你要查找的可能是:\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.mean,temp.shuxing);
m=1;
}
else
{
printf("\n中文是:%s 英文是:%s 例句是:%s 属性是:%s\n",temp.chinese,temp.english,temp.liju,temp.shuxing);
n=1;
n=2;
}
}
}
fileclose(fp);
if(n==2)
if(n==2&&m==0)
{
printf("\nno this");
}
@ -253,11 +243,10 @@ 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);

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save