SHARE
TWEET

Untitled

a guest Oct 23rd, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Program lab1;
  2. Uses GraphABC,Utils;
  3. Const
  4.   K=5;
  5.   N=20000;
  6.   M=2;
  7.  
  8. Var
  9.   Point: array [1..N,1..M] of integer;
  10.   Center: array [1..K,1..M] of integer;
  11.  
  12. Begin
  13.   Window.Title := 'Метод К средних';
  14.   Brush.Color := Color.Black;
  15.   Fillrectangle(0,0,640,480);
  16.  
  17.   for var i:=1 to N do
  18.   Begin
  19.     Point[i,1] := Random(640);
  20.     Point[i,2] := Random(480);
  21.   end;
  22.   for var i:=1 to N do
  23.     SetPixel(Point[i,1],Point[i,2],clwhite);
  24.   for var i:=1 to K do
  25.   begin
  26.     Center[i,1]:=Point[i,1];
  27.     Center[i,2]:=Point[i,2];
  28.     SetPixel(Center[i,1],Center[i,2],clred);
  29.   end;  
  30.   writeln('Время работы: ',Milliseconds/1000,' секунд');
  31. End.
RAW Paste Data
Top