Advertisement
Guest User

Untitled

a guest
Sep 8th, 2018
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program Lab_1_1;
  2. {$APPTYPE CONSOLE}
  3. uses
  4.   SysUtils;
  5.  
  6. var
  7.    x , y , r , CircleCenterX , CircleCenterY : real;
  8.    flag , flag1 , flag2 , flag3 , flag4: boolean;
  9. begin
  10.  
  11.    Writeln ('Enter parametres M( x ; y )');
  12.    repeat
  13.       Write ('x = ');
  14.       try
  15.          Readln (x);
  16.          flag := true;
  17.       except
  18.             on E : EInOutError do
  19.             Writeln ('?rong, you should enter the number ') ;
  20.       end;
  21.    until flag = True;
  22.    repeat
  23.       Write ('y = ');
  24.       try
  25.          Readln (y);
  26.          flag1 := True;
  27.       except
  28.             on E : EInOutError do
  29.             Writeln (' wrong , you should enter the number') ;
  30.       end;
  31.    until flag1 = True;
  32.    Writeln('the parametres of a close set D :');
  33.    Writeln ('Enter the center of a circle(x,y)');
  34.    repeat
  35.    Write('x = ');
  36.       try
  37.          Readln (CircleCenterX);
  38.          flag2 := True;
  39.          except
  40.             on E : EInOutError do
  41.             Writeln ('wrong , you should enter the number') ;
  42.          end;
  43.       until flag2 = True;
  44.          repeat
  45.          Write('y = ');
  46.       try
  47.          Readln (CircleCenterY);
  48.          flag3:=True;
  49.          except
  50.             on E : EInOutError do
  51.             Writeln (' wrong , you should enter the number') ;
  52.          end;
  53.       until flag3 = True;
  54.    repeat
  55.       Writeln ('radius = ');
  56.       try
  57.          Readln (r);
  58.          if r<0
  59.          then
  60.             begin
  61.                flag4:=False;
  62.                Writeln (' wrong,you should enter the number,which is more than 0 ');
  63.             end
  64.          else flag4:=True;
  65.       except
  66.             on E : Exception do
  67.             Writeln (' wrong,you should enter the number,which is more than 0 ') ;
  68.       end;
  69.    until (flag4 = true) and (r > 0);
  70.    if sqrt(sqr(CircleCenterX - x) + sqr(CircleCenterY - y)) <=r then
  71.       Writeln('the dot M belongs to the closed set D')
  72.       else
  73.           Writeln('the dot M does not belong to the closed set D');
  74.    Readln;
  75. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement