#include
using namespace std;
#define MaxVerterNum 100
typedef char VerterType;
typedef int EdgeType;
typedef struct
{
VerterType vexs[MaxVerterNum];
EdgeType edges[MaxVerterNum][MaxVerterNum];
int n, e;
}MGraph;
void createMGraph(MGraph* G)
{
std::cin >> G->n >> G->e;
for (int i = 0; i < G->n; ++i)
{
std::cin >> G->vexs[i];
}
for (int i = 0; i < G->n; ++i)
{
for (int j = 0; j < G->n; ++j)
{
G->edges[i][j] = 0;
}
}
int i, j;
for (int k = 0; k < G->e; ++k)
{
std::cin >> i >> j;
G->edges[i][j] = 1;
G->edges[j][i] = 1;
}
}
int main()
{
MGraph* pg = new MGraph;
createMGraph(pg);
for (int i = 0; i < pg->n; ++i)
{
for (int j = 0; j < pg->n; ++j)
{
std::cout << pg->edges[i][j] << "\t";
}
std::cout << endl;
}
delete pg;
return 0;
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
输入

输出
