#include <stdio.h>
#include <stdlib.h>


int main(void) {
	// your code goes here
	
	int graph[8][8] =        //サイズ８の有向グラフの形
	{
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0}
	};
	
	int r=1;
	int a,b;
	while(r<9){              //ランダムで8個の頂点を生成
		 a = rand() % 8;
		 b = rand() % 8;
		 if (graph[a][b] >0);
		 else{
			graph[a][b] = r;
			r++;
		 }
	}
	
	for(int i = 0; i < 8; i++){                //生成した有向グラフを表示
		for(int g = 0; g < 8; g++){
			printf("%d",graph[i][g]);
		}
		printf("\n");
	}
	

	
	return 0;
}


