#include "stdio.h" #include "stdlib.h" #include "string.h" #include #define FILENAME "翻译文档31.txt" #define shoucanjia "收藏夹56.txt" struct word { char chinese[100]; char english[100]; char liju[100]; char shuxing[100]; }; FILE *FP; FILE *fileopen(char FileName[])//打开翻译文档 { FILE *fp; if((fp=fopen(FileName,"rb"))==NULL) { printf("NO"); } fp=fopen(FileName,"ab+"); } void fileclose(FILE *fp)//关闭翻译文档 { if(fclose(fp)!=NULL) { printf("close defit"); } } void shoucan(word temp)//收藏的单词 { FP=fileopen(shoucanjia); printf("%s %s %s %s ",temp.english,temp.chinese,temp.liju,temp.shuxing); fwrite(&temp,sizeof(temp),1,FP); fileclose(FP); } void findlike()//查收藏夹 { system("cls"); FILE *fp; if((fp=fopen(shoucanjia,"r"))==NULL) { printf("OPEN DEFIT"); } char tempenglish[100]; for(int z=0;z<=100;z++) tempenglish[z]=0; char *res; word temp; int n=0,i=0; printf("PLEAES INPUT ENGLISH:"); printf("输入:"); printf("退格:查看收藏夹内单词\n"); while(1) { int n=0; printf("\n\n\n返回上一级按空格键 "); if(i==0) printf("退格:查看所有单词"); else printf("退格:退后一个单词"); char c=getch(); system("cls"); if(c==32) break; printf("输入单词:"); if(c==8) { tempenglish[i-1]=0; for(int j=0;j