void change(MGraph g1,AGraph& g2){
g1.numvex=g2.numvex;
g1.numedge=g2.numedge;
for(int i = 0; i <g1.numvex ; i++){
g2.adjlist.firstarc = null; //初始化邻接表
}
for(int i=0;i<=g1.numvex;i++)
for(int j=0;i<=g1.numedge;j++)
if(g1[i][j] != 0)
AGraph* s=new AGraph;
s.adjvex = j; //用头插法插入邻接表
s->next=g2.adjlist[ i ].firstarc;
g2.adlist[ i ].firstarc = s;
}