Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program lab1;
- Uses GraphABC,Utils;
- Const
- K=5;
- N=20000;
- M=2;
- Var
- Point: array [1..N,1..M] of integer;
- Center: array [1..K,1..M] of integer;
- Begin
- Window.Title := 'Метод К средних';
- Brush.Color := Color.Black;
- Fillrectangle(0,0,640,480);
- for var i:=1 to N do
- Begin
- Point[i,1] := Random(640);
- Point[i,2] := Random(480);
- end;
- for var i:=1 to N do
- SetPixel(Point[i,1],Point[i,2],clwhite);
- for var i:=1 to K do
- begin
- Center[i,1]:=Point[i,1];
- Center[i,2]:=Point[i,2];
- SetPixel(Center[i,1],Center[i,2],clred);
- end;
- writeln('Время работы: ',Milliseconds/1000,' секунд');
- End.
Add Comment
Please, Sign In to add comment