add: 添加实训 '数据结构课程设计'

This commit is contained in:
2025-12-22 17:09:05 +08:00
parent 778956cec3
commit dff46e6f21
14 changed files with 720 additions and 0 deletions

View 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