Files
Course/PracticalTrain/DataStructure/include/station.h

23 lines
606 B
C

// 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