-
Notifications
You must be signed in to change notification settings - Fork 0
/
generator.~dpr
49 lines (43 loc) · 919 Bytes
/
generator.~dpr
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
program generator;
{$APPTYPE CONSOLE}
uses
SysUtils;
const
tsize = 100;
var
i, j: integer;
tbl: array [1..tsize, 1..tsize] of integer;
begin
AssignFile(output, 'input.txt');
rewrite(output);
randomize();
writeln(tsize);
writeln(1, ' ', tsize);
for i:=1 to tsize do
for j:=1 to i do
begin
if i<>j then
begin
if random(100)<20 then
begin
tbl[i, j]:=random(100)+1;
tbl[j, i]:=tbl[i, j];
end
else
begin
tbl[i, j]:=maxint;
tbl[j, i]:=tbl[i, j];
end;
end
else
tbl[i, j]:=0;
end;
{ TODO -oUser -cConsole Main : Insert code here }
for i:=1 to tsize do
begin
for j:=1 to tsize do
write(tbl[i, j], ' ');
writeln;
end;
close(output);
end.