Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Lab1_1;
- {$APPTYPE CONSOLE}
- uses
- System.SysUtils;
- const
- Theme = 'Theme: This program checks can the circle go into the square ';
- EnterRadius = 'Enter the radius of the circle from 1 to 150';
- EnterSquare = 'Enter a size of the square`s side from 1 to 150';
- CheckZero = 'The size should be bigger then 0';
- CheckReal = 'The size must be the real value';
- Yes = 'Possible';
- No = 'Impossible';
- var
- Radius,Square,i: integer;
- IsCorrect: boolean;
- begin
- Radius:= 0;
- Square:= 0;
- IsCorrect:= False;
- Writeln(Theme);
- repeat
- try
- Writeln(EnterRadius);
- Readln(Radius);
- IsCorrect:= True;
- if (0 > Radius) then
- begin
- Writeln(CheckZero);
- IsCorrect:= False;
- end;
- except
- Writeln(CheckReal);
- end;
- until IsCorrect;
- IsCorrect:= False;
- repeat
- try
- Writeln(EnterSquare);
- Readln(Square);
- IsCorrect:= True;
- if (0 > Square) then
- begin
- Writeln(CheckZero);
- IsCorrect:= False;
- end;
- except
- Writeln(CheckReal);
- end;
- until IsCorrect;
- i:= (Square) div 2;
- if (i)> Radius then
- Writeln(Yes)
- else
- Writeln(No);
- Readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement