Program show; User CRT, Graph; const N=1000; var X, Y:array [1..N] of integer; Gd, Gm, xm, ym, i:integer; begin Gd:=0; Initgraph (Gd, Gm, ); xm:=getmaxX; ym:=getmaxY; Randomize; for i:=1 to N do begin X[i]:=random(xm); Y[i]:=random(ym); PutPixel(X[i], Y[i], 15) end; SetColor(2); Setlinestyle(0,0,3); Rectangle(200, ym-200, 400, ym); Rectangle (250, ym-100, 350, ym-150); Line(180, ym-180, 300, ym-300); Line(420, ym-180, 300, ym-300); Readkey; Repeat for i:=1 to N do begin if (Y[i]<ym) and (GetPixel(X[i], Y[i]+1)=0) then begin PutPixel(X[i], Y[i], 0); inc(Y[i]); PutPixel(X[i], Y[i], 15) end else begin Y[i]:=0; X[i]:=random(xm); PutPixel(X[i], Y[i], 15) end until keypressed; ReadKey; ClearDevice; CloseGraph end.