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 62 63 64 65 66 67 68 69 70 71 72 73
| Program testproc;
uses crt;
Type carte = record nom : string;
bat : array[1..5] of string[8];
end;
tcarte = array[1..10] of carte;
var j, i, chiffr, g, tempr, templ : integer; m, s: string; f: text; lettr, o: char; p: integer; d : tcarte; res: integer;
Procedure cartehasard(var res: integer);
var i, o: integer; s: string[5]; p: string; f: text;
begin
assign(f,'carto.txt');
reset(f);
randomize;
i:=0;
while (not eof(f)) do
begin
read(f,s);
if (s = 'Carte')
then i:=i+1
else readln(f,p)
end;
res:=random(i)+1;
close(f);
End;
begin
assign(f,'carto.txt');
reset(f);
j:=1;
g:= 1;
cartehasard(i);
while (j<i) AND (not eof(f)) do
begin
readln(f,s);
i:=i+1;
while (s<>'') do
begin
readln(f,s);
end;
end;
readln(f, d[g].nom);
i:= 0;
while (i<5) do
begin
i:= i+1;
read(f,d[g].bat[i]);
read(f,m);
while (m<>'') do
begin
read(f,o);
end;
read(f, lettr);
read(f,chiffr);
end;
writeln(d[g].nom);
while (i>0) do
begin
writeln(d[g].bat[i]);
i:=i-1;
end;
close(f);
repeat
until keypressed;
end. |
Partager