生成网络流图

自己yy的算法,多棒啊是不是!!!

 1 int n=100000,m=1000000;
 2 write(n);PAU;write(m);ENT;
 3 int i;
 4 for(i=1;i<=m;){
 5     int last=1;
 6     for(int j=1;i<=m&&j<=10;i++,j++){
 7         int now=rand()%n+1;
 8         while(now==last) now=rand()%n+1;
 9         write(last);PAU;write(now);PAU;write(rand()%100+1);ENT;last=now;
10     }
11     write(last);PAU;write(n);PAU;write(rand()%100+1);ENT;
12 }

 

posted @ 2015-05-28 23:20  AI_Believer  阅读(253)  评论(0编辑  收藏  举报