add: 添加实训 '数据结构课程设计'
This commit is contained in:
23
PracticalTrain/DataStructure/include/station.h
Normal file
23
PracticalTrain/DataStructure/include/station.h
Normal file
@@ -0,0 +1,23 @@
|
||||
// include/station.h
|
||||
#ifndef STATION_H
|
||||
#define STATION_H
|
||||
|
||||
#define MAX_NAME 50
|
||||
#define MAX_STATIONS 100
|
||||
|
||||
typedef struct Station {
|
||||
int id;
|
||||
char name[MAX_NAME];
|
||||
double latitude;
|
||||
double longitude;
|
||||
int stopTime; // 停靠时间(秒)
|
||||
} Station;
|
||||
|
||||
// 站点管理函数
|
||||
int loadStations(const char* filename, Station stations[], int maxStations);
|
||||
int findStationByName(const Station stations[], int count, const char* name);
|
||||
int findStationById(const Station stations[], int count, int id);
|
||||
void displayStation(const Station* station);
|
||||
void displayAllStations(const Station stations[], int count);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user