C
x
31
1
int candidate_count = 0;
2
int preferences[1024][1024];
3
struct a {
4
int winner, loser;
5
} pair[1024];
6
7
void add_pairs(void)
8
{
9
int n = candidate_count;
10
int count = 0;
11
for (int i = 0; i < n; i++)
12
{
13
for (int j = i + 1; j < n + 1; j++)
14
{
15
if (preferences[i][j] > preferences[j][i])
16
{
17
pair[count].winner = i;
18
pair[count].loser = j;
19
count++;
20
}
21
else if (preferences[i][j] < preferences[j][i])
22
{
23
pair[count].winner = j;
24
pair[count].loser = i;
25
count++;
26
}
27
}
28
}
29
return;
30
}
31
$ gcc prog.c -Wall -Wextra -std=c99 -pedantic
Start
/usr/lib/x86_64-linux-gnu/crt1.o: In function `_start': (.text+0x20): undefined reference to `main' collect2: error: ld returned 1 exit status
1
Finish