You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
void enter()
|
|
|
|
|
{
|
|
|
|
|
int i,m=0;
|
|
|
|
|
char n;
|
|
|
|
|
char to[20],ch[2];
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뵥<EFBFBD><EFBFBD>: ");
|
|
|
|
|
scanf("%s",to);
|
|
|
|
|
FILE *fp;
|
|
|
|
|
if((fp=fopen("data.txt","ab+"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n");
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
while(!feof(fp))
|
|
|
|
|
{
|
|
|
|
|
if(fread(&inf[m],LEN,1,fp)==1)
|
|
|
|
|
{
|
|
|
|
|
if(strcmp(to,inf[m].word)==0)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
|
|
|
|
printf("%s\n",inf[m].mean);
|
|
|
|
|
printf("<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?");
|
|
|
|
|
printf("<EFBFBD><EFBFBD>Y<EFBFBD><EFBFBD>y<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%c",&n);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
m++;
|
|
|
|
|
}
|
|
|
|
|
printf("<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD>!\n");
|
|
|
|
|
printf("<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?");
|
|
|
|
|
printf("<EFBFBD><EFBFBD>Y<EFBFBD><EFBFBD>y<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
|
|
|
|
scanf("%c",&n);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
return;
|
|
|
|
|
if(m==0)
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼!\n");
|
|
|
|
|
if((fp=fopen("data.txt","ab+"))==NULL)
|
|
|
|
|
{
|
|
|
|
|
printf("<EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
fclose(fp);
|
|
|
|
|
}
|