这个有什么问题啊?
/*************** 导入 ****************/int Load(PlaneLink *Q,TrustLink *T)
{
int Lflag;
PlaneLink *q;
TrustLink *t;
FILE *fp;
T->next=NULL;
Q->next=NULL;
printf("请选择导入资料(1.航班资料 2.机票资料):");
scanf("%d",&Lflag);
while(Lflag!=0&&Lflag!=1&&Lflag!=2)
{
getchar();
printf("输入错误!\n");
printf("是否继续输入:(1/0)");
scanf("%d",&Lflag);
}
switch(Lflag)
{
case 1:
if((fp=fopen("D:/航班资料.txt","r+"))==NULL)
{
printf("导入失败!\n");
return NULL;
}
printf("成功导入资料:\n");
fscanf(fp,"\t\t\t\t\t航班资料\t\t\t\t\n");
fscanf(fp,"---------------------------------------------------------------------------------------------------------\n");
fscanf(fp,"\t\t|航班编号|始发站 |终点站 |机票价格|机票数 |起飞时间|乘客数 |\n");
//printf("\t\t\t航班资料\t\t\t\n");
//printf("----------------------------------------------------------------------------\n");
//printf("|航班编号|始发站 |终点站 |机票价格|机票数 |起飞时间|乘客数 |\n");
do
{
q=(PlaneLink*)malloc(sizeof(PlaneLink));
fscanf(fp,"%s\n|%8s|%8s|%8s|%7.1f|%8d|%8s|%8d|\n",q->number,q->start,q->end,&q->Piece,&q->tick,q->temps,&q->passege);
//printf("|%8s|%8s|%8s|%7.1f|%8d|%8s|%8d|\n",q->number,q->start,q->end,q->Piece,q->tick,q->temps,q->passege);
printf("%s\n",q->number);
q->next=Q->next;
Q->next=q;
}while(!feof(fp));
fclose(fp);
PrintPlane(q);
return Q;
case 2:
if((fp=fopen("D:/机票资料.txt","r+"))==NULL)
{
printf("导入失败!\n");
return NULL;
}
printf("成功导入资料:\n");
fscanf(fp,"\t\t\t\t\t机票资料\t\t\t\t\n");
fscanf(fp,"---------------------------------------------------------------------------------------------------------\n");
fscanf(fp,"\t\t|客户姓名|性别|有效证件|航班编号|始发站|终点站|机票数量|\n");
//printf("\t\t\t\t\t机票资料\t\t\t\t\n");
//printf("---------------------------------------------------------------------------------------------------------\n");
//printf("\t\t|客户姓名|性别|有效证件|航班编号|始发站|终点站|机票数量|\n");
do
{
t=(TrustLink*)malloc(sizeof(TrustLink));
fscanf(fp,"|%8s|%4s|%8d|%8s|%6s|%6s|%8d|\n",t->TrustName,t->TrustSex,t->TrustNumber,t->TrustPlane,t->TrustStart,t->TrustEnd,t->TrustTick);
printf(fp,"|%8s|%4s|%8d|%8s|%6s|%6s|%8d|\n",t->TrustName,t->TrustSex,t->TrustNumber,t->TrustPlane,t->TrustStart,t->TrustEnd,t->TrustTick);
t->next=T->next;
T->next=t;
}while(!feof(fp));
fclose(fp);
return T;
case 0:
return NULL;
}
}