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.

227 lines
6.0 KiB

6 years ago
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct TXL
{
char XM[20];
char JG[20];
char DHHM1[20];
char DHHM2[20];
char DZYX[20];
char a[20];
char b[20];
char c[20];
char d[20];
char e[20];
};
struct TXL LXR[100];
int num=0,p;
FILE *fp;
void luru()
{
int i;
fp=fopen("D:\\ͨѶ¼.txt","a");
for (i=0;i<100;i++)
{
int k;
printf ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
scanf ("%s",LXR[num].XM);
printf ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
scanf ("%s",LXR[num].JG);
printf ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>绰1\n");
scanf ("%s",LXR[num].DHHM1);
printf ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>绰2\n");
scanf ("%s",LXR[num].DHHM2);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
scanf("%s",LXR[num].DZYX);
num++;
p=num;
printf ("<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD>1<EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
scanf("%d",&k);
if (k==1)
continue;
else
break;
};
fclose(fp);
}
void liulan ()
{
int a,i=0;
if((fp=fopen("ͨѶ¼.txt","r"))==NULL)
printf ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><E7BBB0><EFBFBD><EFBFBD>1 <20><EFBFBD><E7BBB0><EFBFBD><EFBFBD>2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
while(fscanf(fp,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD>᣺%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺%s\n",&LXR[i].XM,&LXR[i].JG,&LXR[i].DHHM1,&LXR[i].DHHM2,&LXR[i].DZYX)!=EOF)
{
printf("%s %s %s %s %s\n",LXR[i].XM,LXR[i].JG,LXR[i].DHHM1,LXR[i].DHHM2,LXR[i].DZYX);
i++;
}
printf ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD>");
scanf("%s",&a);
fclose(fp);
}
void chaxun()
{
int b,n;
char name[20];
int k=0;
if((fp=fopen("ͨѶ¼.txt","r"))==NULL)
{
printf("<EFBFBD>޷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>!\n");
return;
}
while(fscanf(fp,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD>᣺%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺%s\n",&LXR[k].XM,&LXR[k].JG,&LXR[k].DHHM1,&LXR[k].DHHM2,&LXR[k].DZYX)!=EOF)
{
k++;
}
fclose(fp);
printf ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣδ¼<CEB4><C2BC>ͨѶ¼<D1B6><C2BC>ϵͳ<CFB5><CDB3>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3>)\n");
scanf ("%s",&name);
for (n=0;n<k;n++)
{
if (strcmp(LXR[n].XM,name)==0)
{
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD>᣺%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺%s\n",LXR[n].XM,LXR[n].JG,LXR[n].DHHM1,LXR[n].DHHM2,LXR[n].DZYX);
}
}
printf ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD>");
scanf("%s",&b);
}
void xiugai()
{
int l,v,c;
char xm[20];
int k=0;
if((fp=fopen("ͨѶ¼.txt","r"))==NULL)
{
printf("<EFBFBD>޷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>!\n");
return;
}
while(fscanf(fp,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD>᣺%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺%s\n",&LXR[k].XM,&LXR[k].JG,&LXR[k].DHHM1,&LXR[k].DHHM2,&LXR[k].DZYX)!=EOF)
{
k++;
}
fclose(fp);
printf ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣδ¼<CEB4><C2BC>ͨѶ¼<D1B6><C2BC>ϵͳ<CFB5><CDB3>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3>)\n");
scanf ("%s",&xm);
for (l=0;l<k;l++)
{
if (strcmp(LXR[l].XM,xm)==0)
{
num=l;
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD>᣺%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺%s\n",LXR[l].XM,LXR[l].JG,LXR[l].DHHM1,LXR[l].DHHM2,LXR[l].DZYX);
printf("<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ĵ<EFBFBD><EFBFBD><EFBFBD>Ϣ\n1.<2E><><EFBFBD><EFBFBD>\n2.<2E><><EFBFBD><EFBFBD>\n3.<2E><EFBFBD><E7BBB0><EFBFBD><EFBFBD>1\n4.<2E><EFBFBD><E7BBB0><EFBFBD><EFBFBD>2\n5.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
scanf("%d",&v);
if(v==1)
{
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n",LXR[l].XM);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
scanf("%s",&LXR[l].a);
strcpy(LXR[num].XM,LXR[l].a);
fp=fopen("ͨѶ¼.txt","w");
for(l=0;l<k;l++)
fprintf(fp,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD>᣺%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺%s\n",LXR[l].XM,LXR[l].JG,LXR[l].DHHM1,LXR[l].DHHM2,LXR[l].DZYX);
fclose(fp);
}
if(v==2)
{
printf("<EFBFBD><EFBFBD><EFBFBD>᣺%s\n",LXR[l].JG);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
scanf("%s",&LXR[l].b);
strcpy(LXR[num].JG,LXR[l].b);
fp=fopen("ͨѶ¼.txt","w");
for(l=0;l<k;l++)
fprintf(fp,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD>᣺%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺%s\n",LXR[l].XM,LXR[l].JG,LXR[l].DHHM1,LXR[l].DHHM2,LXR[l].DZYX);
fclose(fp);
}
if(v==3)
{
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>%s\n",LXR[l].DHHM1);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
scanf("%s",&LXR[l].c);
strcpy(LXR[num].DHHM1,LXR[l].c);
fp=fopen("ͨѶ¼.txt","w");
for(l=0;l<k;l++)
fprintf(fp,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD>᣺%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺%s\n",LXR[l].XM,LXR[l].JG,LXR[l].DHHM1,LXR[l].DHHM2,LXR[l].DZYX);
fclose(fp);
}
if(v==4)
{
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD>%s\n",LXR[l].DHHM2);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
scanf("%s",&LXR[l].d);
strcpy(LXR[num].DHHM2,LXR[l].d);
fp=fopen("ͨѶ¼.txt","w");
for(l=0;l<k;l++)
fprintf(fp,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD>᣺%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺%s\n",LXR[l].XM,LXR[l].JG,LXR[l].DHHM1,LXR[l].DHHM2,LXR[l].DZYX);
fclose(fp);
}
if(v==5)
{
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺%s\n",LXR[l].DZYX);
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޸ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ\n");
scanf("%s",&LXR[l].e);
strcpy(LXR[num].DZYX,LXR[l].e);
fp=fopen("ͨѶ¼.txt","w");
for(l=0;l<k;l++)
fprintf(fp,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD>᣺%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><EFBFBD>%s\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䣺%s\n",LXR[l].XM,LXR[l].JG,LXR[l].DHHM1,LXR[l].DHHM2,LXR[l].DZYX);
fclose(fp);
}
break;
}
}
num=p;
printf ("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD>");
scanf("%s",&c);
}
void caidan()
{
int t;
printf("-----------------------ͨѶ¼------------------------\n");
printf("| (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBB9A6>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>) |\n");
printf("| 1.<2E><>Ϣ¼<CFA2><C2BC> |\n");
printf("| 2.<2E><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD> |\n");
printf("| 3.<2E><>Ϣ<EFBFBD><CFA2>ѯ |\n");
printf("| 4.<2E><>Ϣ<EFBFBD>޸<EFBFBD> |\n");
printf("| 5.<2E>˳<EFBFBD>ϵͳ |\n");
printf("-----------------------------------------------------\n");
scanf("%d",&t);
switch(t)
{
case 1:{
luru();
caidan();
break;
}
case 2:{
liulan();
caidan();
break;
}
case 3:{
chaxun();
caidan();
break;
}
case 4:{
xiugai();
caidan();
break;
}
case 5:
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD>ͨѶ¼\n");
exit(0);
system("cls");
break;
}
}
int main()
{
caidan();
}