|
|
|
@ -1,11 +1,11 @@
|
|
|
|
|
#include "stdio.h"
|
|
|
|
|
#include "stdlib.h"
|
|
|
|
|
#include "string.h"
|
|
|
|
|
#include"stdio.h"
|
|
|
|
|
#include"stdlib.h"
|
|
|
|
|
#include"string.h"
|
|
|
|
|
#include<conio.h>
|
|
|
|
|
#include <windows.h>
|
|
|
|
|
#include<windows.h>
|
|
|
|
|
#define FILENAME "럇陋匡도31.txt"
|
|
|
|
|
#define shoucanjia "澗꾜셸56.txt"
|
|
|
|
|
|
|
|
|
|
#define FILENAME1 "1.txt"
|
|
|
|
|
struct word//땍屢써뭐竟
|
|
|
|
|
{
|
|
|
|
|
char chinese[100];
|
|
|
|
@ -45,6 +45,7 @@ void fileclose(FILE *fp)//
|
|
|
|
|
if(fclose(fp)!=NULL)
|
|
|
|
|
{
|
|
|
|
|
color(4); printf("close defit");
|
|
|
|
|
exit(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -137,6 +138,65 @@ void findlike()//
|
|
|
|
|
fileclose(fp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void shanchu()
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
|
FILE *fp;
|
|
|
|
|
FILE *fp1;
|
|
|
|
|
word temp;
|
|
|
|
|
char c[100];
|
|
|
|
|
int n=0,m=0,sum=0,j=0;
|
|
|
|
|
if((fp=fopen(FILENAME,"rb"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("OPEN DEFIT");
|
|
|
|
|
}
|
|
|
|
|
if((fp1=fopen(FILENAME1,"wb+"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("OPEN DEFIT");
|
|
|
|
|
}
|
|
|
|
|
// scanf("%s",&sum);
|
|
|
|
|
scanf("%s",c);
|
|
|
|
|
while(fread(&temp,sizeof(word),1,fp))
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(temp.english,c)!=0)
|
|
|
|
|
{
|
|
|
|
|
// printf("%s",temp.english);
|
|
|
|
|
m=1;
|
|
|
|
|
// j=sizeof(word);
|
|
|
|
|
// sum=sum+j;
|
|
|
|
|
|
|
|
|
|
// printf("1");
|
|
|
|
|
fwrite(&temp,sizeof(temp),1,fp1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
n=1;
|
|
|
|
|
// rewind(fp);
|
|
|
|
|
// fseek(fp,sum,0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(fclose(fp1))//关闭文件并防止文件关闭失败。
|
|
|
|
|
{
|
|
|
|
|
printf("cann't close linshi file");
|
|
|
|
|
}
|
|
|
|
|
fclose(fp1);
|
|
|
|
|
if(fclose(fp))//关闭文件并防止文件关闭失败。
|
|
|
|
|
{
|
|
|
|
|
printf("cann't close this file");
|
|
|
|
|
}
|
|
|
|
|
remove(FILENAME);
|
|
|
|
|
|
|
|
|
|
if (rename(FILENAME1,FILENAME) == 0)
|
|
|
|
|
printf("Renamed %s to %s.\n",FILENAME1,FILENAME);
|
|
|
|
|
else
|
|
|
|
|
perror("rename");
|
|
|
|
|
if(n==1&&m==1)
|
|
|
|
|
printf("删除成功!");
|
|
|
|
|
else
|
|
|
|
|
printf("删除失败,词库没有此单词!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
void change()//亶볶럇陋
|
|
|
|
|
{
|
|
|
|
|
system("cls");
|
|
|
|
@ -281,7 +341,8 @@ int caidan()//
|
|
|
|
|
printf(" # 0.藁놔 1.渴흙데늦 #\n");
|
|
|
|
|
printf(" # #\n");
|
|
|
|
|
printf(" # 2.꿴冷데늦 3.헌팁 #\n");
|
|
|
|
|
printf(" # 4.查看收藏夹 #\n");
|
|
|
|
|
printf(" # #\n");
|
|
|
|
|
printf(" # 4.查看收藏夹 5.删除单词 #\n");
|
|
|
|
|
printf(" *********************************************************\n");
|
|
|
|
|
printf("\n");
|
|
|
|
|
scanf("%d",&choose);
|
|
|
|
@ -292,6 +353,7 @@ int caidan()//
|
|
|
|
|
case 2:change();break;
|
|
|
|
|
case 3:system("cls");break;
|
|
|
|
|
case 4:findlike();break;
|
|
|
|
|
case 5:shanchu();break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -300,3 +362,4 @@ int main()//
|
|
|
|
|
{
|
|
|
|
|
caidan();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|