};
struct Graph_Matrix{
int Matrix[N+1][N+1];
int nume;
int numv;
Graph_Matrix(){
cout<<"input the num of vext:"<<endl;
cin>>numv;
cout<<"input the num of edge:"<<endl;
cin>>nume;
for(int i=0;i<numv;++i)
for(int j=0;j<numv;++j){
Matrix[i][j]=0;
}
}
void init();
void show();
};
void Graph_Matrix::init(){
cout<<"init the graph..."<<endl;
for(int i=0;i<nume;++i){
int start ,end;
cout<<"int the start and the end point :"<<endl;
cin>>start>>end;
cout<<"input the weight of the edge :"<<endl;
cin>>Matrix[start][end];
}
}
void Graph_Matrix::show(){
for(int i=0;i<numv;++i)
for(int j=0;j<numv;++j){
cout<<Matrix[i][j]<<" ";
if(j==numv-1)
cout<<endl;
}
}
int main(){
Graph graph(5);
graph.addSingle(0,4);
graph.addSingle(1,0);
graph.addSingle(1,2);
graph.addSingle(1,3);
graph.addSingle(2,4);
graph.outdegree();
graph.indegree();
}
#includeusing namespace std;#define N 10struct Edge{ Edge* next; int start ; int end ; int weight; Edge(int s,int e):start(s),end(e){ weight = 1; next = NULL; }};struct Vext{ Edge* hea