文章
126
粉丝
12
获赞
0
访问
22.7k
int printVertices(MGraph G){
int indegrees[G.numVertices];
int outdegrees[G.numVertices];
memset(indegrees, 0, sizeof(indegrees));
memset(outdegrees, 0, sizeof(outdegrees));
for(int i=0;i<G.numVertices;i++){
for(int j=0;j<G.numVertices;j++){
outdegrees[i] += G.Edge[i][j];
indegrees[j] += G.Edge[i][j];
}
}
int t=0;
for(int i=0;i<G.numVertices;i++){
if(outdegrees[i]>indegrees[i]){
t++;
}
}
return t;
}
登录后发布评论
暂无评论,来抢沙发