Добавил:
3axap4uk_
Рыльский филиал МГТУ ГА.
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Практические / prakt10 / 10,2
.pas program loto;
uses crt;
type lotnum=set of 1..36;
var c:char;
lotto:lotnum;
k,i:1..5;
num:1..36;
ok:boolean;
procedure vivod(l:lotnum);
{вывод чисел на экран(с помеченными выйгрышными номерами)}
var i:1..36;
begin
clrscr;
textcolor(15);
for i:=1 to 36 do
begin
if i in l then
begin
textcolor(29);
write(i:4);
textcolor(85);
end
else
write(I:4);
if i mod 7=0 then writeln;
end;
end;
begin
repeat lotto:=[];
for i:=1 to 5 do
begin
repeat num:=random(36)+1;
if num in lotto then ok:=false
else
begin
lotto:=lotto+[num];
ok:=true;
end;
until ok;
end;
vivod(lotto);
gotoxy(1,23);
c:=readkey;
until c=#27;
clrscr;
end.
uses crt;
type lotnum=set of 1..36;
var c:char;
lotto:lotnum;
k,i:1..5;
num:1..36;
ok:boolean;
procedure vivod(l:lotnum);
{вывод чисел на экран(с помеченными выйгрышными номерами)}
var i:1..36;
begin
clrscr;
textcolor(15);
for i:=1 to 36 do
begin
if i in l then
begin
textcolor(29);
write(i:4);
textcolor(85);
end
else
write(I:4);
if i mod 7=0 then writeln;
end;
end;
begin
repeat lotto:=[];
for i:=1 to 5 do
begin
repeat num:=random(36)+1;
if num in lotto then ok:=false
else
begin
lotto:=lotto+[num];
ok:=true;
end;
until ok;
end;
vivod(lotto);
gotoxy(1,23);
c:=readkey;
until c=#27;
clrscr;
end.