求dalao看看我这个功能1系统哪里出问题了 (报错)
真.萌新
```--------------------Configuration: 1 - Win32 Debug--------------------
--------------------Configuration: 1 - Win32 Debug--------------------
Compiling...
1.cpp
C:\Users\16926\Desktop\vc6.0data\课余\text\1.cpp(104) : error C2065: 'strcmp' : undeclared identifier
C:\Users\16926\Desktop\vc6.0data\课余\text\1.cpp(162) : error C2065: 'display_line' : undeclared identifier
执行 cl.exe 时出错.
1.obj - 1 error(s), 0 warning(s)
#include <stdio.h>
#include <stdlib.h>
#define MAX 1024
//客户信息
typedef struct Custom
{
char name[12]; //客户姓名
char sex[3]; //客户性别
char phonenumber[20]; //客户手机号码
char idcard[20]; //客户身份证号码
int num; //客户选择的机次号
struct Custom *next; //下一个结点
} Custom;
//头结点
typedef struct Customhead
{
int count;
Custom *next;
} Customhead;
//航班信息
typedef struct airline
{
char line_num; //航班号
char start_place[20]; //起飞地
char end_place[20]; //目的地
char time1[10]; //起飞时间
char time2[10]; //降落时间
int total; //总座位数
int left; //剩余座位数
struct airline *next; //下一个结点
} airline;
//头结点
typedef struct airlinehead
{
int count;
airline *next;
} airlinehead;
airlinehead* import(int n,airlinehead *pheadline) //录入航班
{
airline *temp = new airline;
temp->next=NULL;
pheadline->next=temp;
pheadline->count = n;
for(int i=1; i<n; i++)
{
printf("请输入%d个航班号:",i);
scanf("%s",&temp->line_num);
printf("请输入%d个航班的起飞地:",i);
scanf("%s",&temp->start_place);
printf("请输入%d个航班的目的地:",i);
scanf("%s",&temp->start_place);
printf("请输入%d个航班的起飞时间:",i);
scanf("%s",&temp->time1);
printf("请输入%d个航班的降落时间:",i);
scanf("%s",&temp->time2);
printf("请输入%d个航班的总座位数:",i);
scanf("%s",&temp->total);
if(i<n-2)
{
temp->next = new airline;
if(temp->next == NULL)
{
printf("分配内存失败\n");
exit(1);
}
temp->next->next=NULL;
temp = temp->next;
}
}
}
airline* query(airlinehead *phead) //查询航班信息
{
int choose;
airline *find=NULL;
airline *temp;
printf("=============查询=============\n");
printf("* * * * 1按航班号查询* * * * \n");
printf("* * * * 2按起飞地查询* * * * \n");
printf("=============================\n");
printf("请选择:");
scanf("%d",&choose);
switch(choose)
{
case 1:
char line_num[10];
printf("请输入航班号:");
scanf("%s",&line_num);
temp=phead->next;
while (temp)
{
if(strcmp(temp->line_num,line_num) == 0)
{
find=temp;
return temp;
break;
}
else
{
temp = temp->next;
}
}
if(!temp)
{
printf("没有找到航班信息。");
return NULL;
}
break;
}
}
int main ()
{
airlinehead *headline=new airlinehead;
headline->count=0;
headline->next=NULL;
int select;
int air_number;
int n=0;
a:
system("cls");
printf("\t|******************************************|\n");
printf("\t|* * * * * * * * 1.录入航班* * * * * * * * |\n");
printf("\t|* * * * * * * * 2.查询航班* * * * * * * * |\n");
printf("\t|* * * * * * * * 3.订票* * * * * * * * * * |\n");
printf("\t|* * * * * * * * 4.退票* * * * * * * * * * |\n");
printf("\t|* * * * * * * * 5.退出程序* * * * * * * * |\n");
printf("\t|******************************************|\n");
printf("请选择所需的服务;\n");
scanf("%d",&select);
switch(select)
{
case 1:
int num;
printf("请选择您要录入的航班的数目: ");
scanf("%d",&num);
printf("\n");
import(num,headline);
printf("\n");
//display_all_line(headline);
printf("航班信息成功录入。。");
printf("\n\n");
break;
case 2:
airline *find;
find=query(headline);
if(find)
{
display_line(find);
}
printf("按任意键返回.........\n");
getchar();
break;
case 3:
printf("按任意键返回.........\n");
getchar();
break;
case 4:
printf("按任意键返回.........\n");
getchar();
break;
case 5:exit(0);
}
return 0;
}