Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program lab1_1;
- {$APPTYPE CONSOLE}
- uses
- System.SysUtils;
- var
- first,second,third: double;
- isCorrect: boolean;
- begin
- isCorrect:= false ;
- repeat
- try
- writeln('Enter the length of the first segment:');
- readln(first);
- writeln('Enter the length of the second segment:');
- readln(second);
- writeln('Enter the length of the third segment:');
- readln(third);
- isCorrect:=true;
- if ((first<=0) or (second<=0) or (third<=0)) then
- begin
- Writeln('The length must be greater than 0!');
- isCorrect := False;
- end;
- except
- Writeln('Try again!');
- end;
- until (isCorrect);
- if ( (first+second > third) and (first+third > second) and (second+third > first)) then
- writeln ('Possible.')
- else
- writeln ('Impossible.');
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement