Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program lab1_1;
- {$APPTYPE CONSOLE}
- {$R *.res}
- uses
- System.SysUtils, Math;
- var
- ValueX, ValueY, r: double;
- Belongs, NoBelongs:String;
- IsCorrect: Boolean;
- begin
- IsCorrect := False;
- Belongs:= 'The point belongs to the closed set D';
- NoBelongs:= 'The point NOT belongs to the closed set D';
- repeat
- try
- Writeln('Enter the X coordinate of point M');
- Readln(ValueX);
- Writeln('Enter the Y coordinate of point M');
- Readln(ValueY);
- IsCorrect := True;
- except
- Writeln('You did not enter a coordinate, try again.');
- end;
- until (IsCorrect);
- if (Power((ValueX - 1), 2) + Power((ValueY - 1), 2) <= 1) then
- begin
- Writeln(Belongs);
- end
- else
- begin
- Writeln(NoBelongs);
- end;
- Readln(r);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement