Uses Graph; Var V,S,T,Time,AllT,FirstCarD,UleTee : Real; D,M,AK,TS,HL,HLMin,NoHL : Integer; SL : Boolean; SS,SS2 : String; Begin Randomize; For TS:=1 to 100 do Begin T:=Random(4); If T >= 2 then V:=6 else V:=(Random(201)+400)/100; Time:=0.8/V; SL:=True; FirstCarD:=0.3/V * 40 * 1000; AK:=Random(191)+10; While SL do Begin FirstCarD:=FirstCarD-AK; AK:=Random(191)+10; If ( AK > 80 ) and ( FirstCarD < 110 ) then Begin UleTee:=((110-FirstCarD)/1000)/40; SL:=False; End; End; AllT:=Time * 60 + UleTee * 60 + T; If (AllT-10 > 0) and (AllT-10 < 1) then Inc(HLMin); If (AllT-10 <= 0) then Inc(NoHL); End; { Writeln('NoHL=',NoHL); Writeln('HLMin=',HlMin); } Str(NoHL,SS); Str(HlMin,SS2); D:=Detect; InitGraph(D,M,'C:\BP\BGI'); OutTextXY(130,350-NoHL*4,SS); OutTextXY(100,350-HLMin*4,SS2); Line(180,350,440,350); Line(187,343,446,343); Line(180,350,180,130); Line(187,343,187,123); Line(180,350,187,343); Line(440,350,447,343); Line(180,130,187,123); Line(180,349-NoHL*4,186,344-NoHL*4); Line(180,349-HLMin*4,186,344-HLMin*4); SetColor(0); Line(350,343,385,343); Line(250,343,285,343); SetColor(9); SetFillStyle(1,9); Bar3D(225, 350, 275, 350-NoHL*4,10, TopOn); SetColor(3); SetFillStyle(1,3); Bar3D(325, 350, 375, 350-HLMin*4,10, TopOn); SetColor(3); OutTextXY(350,370,'2'); SetColor(9); OutTextXY(245,370,'1'); OutTextXY(30,400,'1-opozdanie rebjenka'); SetColor(3); OutTextXY(30,420,'2-prihod vovremja'); Readln; CloseGraph; End.