标签:graph ext sdn stdio.h add sizeof temp int struct
结构体什么的最优美了
#include <stdio.h> #include <string.h> template<int N,int M> struct Graph { int top; struct Vertex{ int head; }V[N]; struct Edge{ int v,next; }E[M]; void init(){ memset(V,-1,sizeof(V)); top = 0; } void add_edge(int u,int v){ E[top].v = v; E[top].next = V[u].head; V[u].head = top++; } }; Graph<1000,10000> g; int main() { return 0; }
来自
标签:graph ext sdn stdio.h add sizeof temp int struct
原文地址:http://www.cnblogs.com/ZDHYXZ/p/7651748.html