VadimThink

Laba1_1 Delphi

Sep 9th, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.88 KB | None | 0 0
  1. program Lab1_1;
  2. {$APPTYPE CONSOLE}
  3. uses
  4. System.SysUtils;
  5. const
  6.     Theme = 'Theme: Can the circle go into the square?';
  7.     EnterRadius = 'Enter the radius of the circle from 1 to 150';
  8.    EnterSquare = 'Enter a size of the square`s side from 1 to 150';
  9.    CheckZero = 'The size should be bigger then 0';
  10.    CheckReal = 'The size must be the real value';
  11.    Yes = 'Possible';
  12.    No = 'Impossible';
  13. var Radius,Square,i:real;
  14. IsCorrect:boolean ;
  15.  
  16. begin
  17.     IsCorrect:= False;
  18.    Writeln(Theme);
  19.     repeat
  20.     try
  21.         Writeln(EnterRadius);
  22.         Readln(Radius);
  23.         Writeln(EnterSquare);
  24.         Readln(Square);
  25.         IsCorrect:= True;
  26.             if (0 > Radius) or (0 > Square) then
  27.         begin
  28.             Writeln(CheckZero);
  29.             IsCorrect:= False;
  30.         end;
  31.     except
  32.         Writeln(CheckReal);
  33.         end;
  34.    until IsCorrect;
  35.    i:= Square/2;
  36.    if (i)> Radius then
  37.     Writeln(Yes)
  38.    else
  39.     Writeln(No);
  40.    readln;
  41. end.
Advertisement
Add Comment
Please, Sign In to add comment