traffic.h

来自「次界面好用但是也可能有许多不足还希望有贤人志士指点迷津!」· C头文件 代码 · 共 74 行

H
74
字号
#define MAX_VERTEX_NUM 20
#define MAX_LINE 24
#define OK 1
#define ERROR 0
#define FALSE 0
#define TRUE 1
#define YES 1
#define NO 0

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>

typedef enum{DG,DN,UDG,UDN}Gkind;
typedef enum{TRAIN,FLY}KindType;
typedef int status;
typedef char Vertextype[16];

typedef struct Dtime
{
int year;
int month;
int day;
int hour;
int minute;
int second;
}Dtime;

typedef struct Vehi
{
int money;
int line;
struct Dtime starttime[MAX_LINE];
struct Dtime drivetime;
}Vehi;


typedef struct ArcNode
{
int adjvex;
struct ArcNode *nextarc;
Vehi veh[2];
}ArcNode;

typedef struct VNode
{
Vertextype data;
ArcNode * firstarc;
}VNode,AdjList[MAX_VERTEX_NUM];

typedef struct
{
AdjList vertices;
int vexnum,arcnum;
Gkind kind;
}ALGraph;

void welcome();
void openfile(char *);
status Inite(ALGraph &G);
status Edit(ALGraph &G);
status Creat(ALGraph &G);
status Scan(ALGraph G);
status Addarc(ALGraph &G);
status Delarc(ALGraph &G);
status Addvex(ALGraph &G);
status Delvex(ALGraph &G);
status Inqurie(ALGraph G);
status shorttime(ALGraph ,int ,int ,KindType kind);
status lessmoney(ALGraph ,int ,int ,KindType );
status lesschange(ALGraph ,int ,int ,KindType );

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?