Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. program lab1_1;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5.  
  6.  
  7. uses
  8. System.SysUtils;
  9.  
  10. var
  11. first,second,third: double;
  12. isCorrect: boolean;
  13.  
  14. begin
  15. isCorrect:= false ;
  16.  
  17. repeat
  18. try
  19. writeln('Enter the length of the first segment:');
  20. readln(first);
  21. writeln('Enter the length of the second segment:');
  22. readln(second);
  23. writeln('Enter the length of the third segment:');
  24. readln(third);
  25. isCorrect:=true;
  26. if ((first<=0) or (second<=0) or (third<=0)) then
  27. begin
  28. Writeln('The length must be greater than 0!');
  29. isCorrect := False;
  30. end;
  31.  
  32.  
  33. except
  34. Writeln('Try again!');
  35. end;
  36. until (isCorrect);
  37.  
  38. if ( (first+second > third) and (first+third > second) and (second+third > first)) then
  39. writeln ('Possible.')
  40. else
  41. writeln ('Impossible.');
  42. readln;
  43.  
  44. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement