Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.86 KB | None | 0 0
  1. program lab1_1;
  2. {$APPTYPE CONSOLE}


  3. {$R *.res}
  4. uses
  5.   System.SysUtils, Math;


  6. var
  7.   ValueX, ValueY: Double;
  8.   Belongs, NoBelongs: string;
  9.   IsCorrect: Boolean;
  10. begin
  11.     IsCorrect := False;
  12.     Belongs:= 'The point belongs to the closed set D';
  13.     NoBelongs:= 'The point NOT belongs to the closed set D';
  14.       repeat
  15.         try
  16.                Writeln('Enter the X coordinate of point M');
  17.                Readln(ValueX);
  18.                Writeln('Enter the Y coordinate of point M');
  19.                Readln(ValueY);
  20.                 IsCorrect := True;
  21.         except
  22.                Writeln('You did not enter a coordinate, try again.');
  23.         end;
  24.       until (IsCorrect);
  25.       if (Power((ValueX - 1), 2) + Power((ValueY - 1), 2) <= 1) then
  26.         Writeln(Belongs);
  27.    else
  28.          Writeln(NoBelongs);
  29. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement