Переведите на алгоритмический язык program model;
var i, i1, if1, noted, nend : integer;
ta, tb, dt, t, pot: real;
a: array[1..3] of real;
b : array[1..3] of real;
tod : array[1..2] of real;
tz : array[1..3] of real;
tp: array[1..2] of real;
nz: array[1..3] of integer;
np: array[1..2] of integer;
n: array[1..2] of integer;
procedure DAT (a,b : real; var c:real);
begin

randomize;
c := a + random (round ( b ));
end;
begin
for i:=1 to 3 do
readln (a [i], b [i]);
readln (ta, tb, dt);
for i:=1 to 3 do
begin
nz [i]:= 0;
if i < 3 then
begin
n[i] := 0;
np[i] := 0;
end;
end;

for i1:= 1 to 5 do
begin
nend:= 0;
noted:= 0;
t:= 0;
for i:= 1 to 3 do
begin
tz[i]:= 0;
if i < 3 then tp[ i ]:= 0
end;
while nend < 150 do
begin
for i:= 1 to 2 do
if np[i] = 1 then
if tp[i]<=0 then
begin
np[i]:= 0;
nend:= nend + 1;
end;

if1:= 0;
for i:= 1 to 3 do
begin
if nz[ i ] = 1 then
if tz[ i ] < 0 then
begin
if1:= 1;
nz[ i ]:= 0;
if i = 3 then n[2]:= n[ 2 ] + 1
else n[1]:= n[ 1 ] + 1
end;
end;

for i:= 1 to 2 do
if n[i] > 0 then
if np[i]= 0 then
begin
n[i]:= n[i] - 1;
np[i]:= 1;
tp[i]:= tod[ i ]
end;

if t <=0 then
begin
if1:= 0;
for i:= 1 to 3 do
if if1 = 0 then
if nz[ i ] = 0 then
begin
nz[ i ]:= 1;
DAT ( a[ i ], b[ i ], tz[ i ] );
if1:= 1;
end;

if if1 = 0 then noted:= noted + 1;

DAT ( ta, tb, t );
end;
t:= t - dt;
for i:= 1 to 3 do
begin
if i < 3 then tp[i]:= tp[ i ] - dt;

tz[i]:= tz[i] - dt;
end;
end;
end;
pot:= noted/( nend + noted);
writeln ( nend);
writeln (noted);
writeln (pot);

end.

bileskayilona bileskayilona    2   07.05.2021 21:28    0

Другие вопросы по теме Информатика