2.5 样例2

struct vertex
{
 // edge:
 vector <vertex*> edge; 
 /*vertex的其他属性*/
};
vertex G[max_v];


int main()
{
int num_e;
int num_v;
cin>>num_v>>num_e;
for(int i=0;i<num_e;i++)
{
    int a,b;
    cin>>a>>b;
 G[a].edge.push_back(&G[b]);
}
//图的操作
return 0;

}
原文地址:https://www.cnblogs.com/weiweiyi/p/5235885.html