資源簡介
C++車票管理系統 源代碼 大作業 用C++代碼實現的簡單的車票管理系統 能夠查詢發車時間 路線 車票剩余量等等
代碼片段和文件信息
#include
#include
#include
using?namespace?std;
struct?bus_system{
int?number;
char?time[6]position_start[10]position_end[10];
double?interval;
int?passenger_limit;
int?ticket;
bus_system*next;
};
bus_system*p;
void?creat(bus_system*&head){
bus_system*s;
s=new?bus_system;
s->next=NULL;
cout<<“班次:???“;
cin>>s->number;
cout<<“發車時間(如08:00):???“;
cin>>s->time;
cout<<“起點站:???“;
scanf(“%s“s->position_start);
cout<<“終點站:???“;
scanf(“%s“s->position_end);
cout<<“行車時間:???“;
cin>>s->interval;
cout<<“限載人數:???“;
cin>>s->passenger_limit;
s->ticket=0;
if(head==NULL)?head=s;
else?p->next=s;
p=s;
cout<<“——————————錄入信息完畢,返回上一層——————————“< return;
}
void?scan(bus_system*&head){
bus_system*s;
s=head;
cout<<
評論
共有 條評論