Advertisement
Guest User

Untitled

a guest
Sep 12th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.81 KB | None | 0 0
  1. program lab1_1;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. {$R *.res}
  6. uses
  7.   System.SysUtils, Math;
  8.  
  9. var
  10.   ValueX, ValueY, r: double;
  11.   Belongs, NoBelongs:String;
  12.   IsCorrect: Boolean;
  13. begin
  14. IsCorrect := False;
  15. Belongs:= 'The point belongs to the closed set D';
  16. NoBelongs:= 'The point NOT belongs to the closed set D';
  17.   repeat
  18.       try
  19.         Writeln('Enter the X coordinate of point M');
  20.         Readln(ValueX);
  21.         Writeln('Enter the Y coordinate of point M');
  22.         Readln(ValueY);
  23.         IsCorrect := True;
  24.       except
  25.         Writeln('You did not enter a coordinate, try again.');
  26.       end;
  27.   until (IsCorrect);
  28.   if (Power((ValueX - 1), 2) + Power((ValueY - 1), 2) <= 1) then
  29.       begin
  30.       Writeln(Belongs);
  31.       end
  32.   else
  33.       begin
  34.       Writeln(NoBelongs);
  35.       end;
  36.       Readln(r);
  37. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement