...
while (1)
{
cin >> choice;
switch (choice)
{
case 1:
...
case 2:
...
default:
...
}
if (choice == 1 || choice == 2) break;
}
...
typedef struct ANode {
int adjvex; //该边的终点编号
struct ANode *nextarc; //指向下一条边的指针
int name[10]; //该边的权值等信息
}ArcNode;
typedef struct Vnode {
char data; //顶点信息
ArcNode *firstarc; //指向第一条边
}VNode;
typedef struct {
VNode adjlist[MAXV]; //邻接表
int n, e; //途中顶点数n和边数e
}ALGraph;