add: 添加实训 '数据结构课程设计'
This commit is contained in:
22
PracticalTrain/DataStructure/include/route.h
Normal file
22
PracticalTrain/DataStructure/include/route.h
Normal file
@@ -0,0 +1,22 @@
|
||||
// include/route.h
|
||||
#ifndef ROUTE_H
|
||||
#define ROUTE_H
|
||||
|
||||
#include "station.h"
|
||||
|
||||
#define MAX_STATIONS_PER_ROUTE 50
|
||||
|
||||
typedef struct BusRoute {
|
||||
int id;
|
||||
char routeName[50];
|
||||
int stationCount;
|
||||
int stations[MAX_STATIONS_PER_ROUTE]; // 站点ID序列
|
||||
double segmentTimes[MAX_STATIONS_PER_ROUTE]; // 每段行驶时间(分钟)
|
||||
} BusRoute;
|
||||
|
||||
// 线路管理函数
|
||||
int loadRoutes(const char* filename, BusRoute routes[], int maxRoutes);
|
||||
void displayRoute(const BusRoute* route, const Station stations[], int stationCount);
|
||||
void displayAllRoutes(const BusRoute routes[], int routeCount, const Station stations[], int stationCount);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user