Advertisement
VadimThink

Laba1_1 Delphi

Sep 10th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.16 KB | None | 0 0
  1. program Lab1_1;
  2. {$APPTYPE CONSOLE}
  3. uses
  4. System.SysUtils;
  5. const
  6.     Theme = 'Theme: This program checks 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
  14.     Radius,Square,i: integer;
  15.     IsCorrect: boolean;
  16. begin
  17.     Radius:= 0;
  18.    Square:= 0;
  19.     IsCorrect:= False;
  20.    Writeln(Theme);
  21.     repeat
  22.     try
  23.         Writeln(EnterRadius);
  24.         Readln(Radius);
  25.          IsCorrect:= True;
  26.          if (0 > Radius) then
  27.          begin
  28.             Writeln(CheckZero);
  29.             IsCorrect:= False;
  30.         end;
  31.     except
  32.         Writeln(CheckReal);
  33.         end;
  34.    until IsCorrect;
  35.    IsCorrect:= False;
  36.    repeat
  37.     try
  38.         Writeln(EnterSquare);
  39.         Readln(Square);
  40.         IsCorrect:= True;
  41.             if (0 > Square) then
  42.         begin
  43.             Writeln(CheckZero);
  44.             IsCorrect:= False;
  45.         end;
  46.     except
  47.         Writeln(CheckReal);
  48.         end;
  49.    until IsCorrect;
  50.    i:= (Square) div 2;
  51.    if (i)> Radius then
  52.     Writeln(Yes)
  53.    else
  54.     Writeln(No);
  55.    Readln;
  56. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement