Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program laba_1;
- {$APPTYPE CONSOLE}
- uses
- sysUtils;
- var
- deg1, deg2, deg3 : real;
- IsCorrect : boolean;
- begin
- writeln ('Enter a value of corners');
- repeat
- try
- IsCorrect:= TRUE;
- readln (deg1);
- if (deg1 < 0) or (deg1 > 180) then
- begin
- IsCorrect:= FALSE;
- writeln('Enter the correct value for the first corner (from 1 to 180).');
- end;
- except
- IsCorrect:= FALSE;
- writeln ('Enter the correct value');
- end
- until IsCorrect;
- repeat
- try
- IsCorrect:= TRUE;
- readln (deg2);
- if (deg2 < 0) or (deg2 > 180) then
- begin
- IsCorrect:= FALSE;
- writeln('Enter the correct value for the second corner (from 1 to 180).');
- end;
- except
- IsCorrect:= FALSE;
- writeln ('Enter the correct value');
- end
- until IsCorrect;
- repeat
- try
- IsCorrect:= TRUE;
- readln (deg3);
- if (deg3 < 0) or (deg3 > 180) then
- begin
- IsCorrect:= FALSE;
- writeln('Enter the correct value for the third corner (from 1 to 180).');
- end;
- except
- IsCorrect:= FALSE;
- writeln ('Enter the correct value');
- end
- until IsCorrect;
- if (deg1+deg2+deg3=180) then
- begin
- if (deg1=deg2) or (deg1=deg3) or (deg2=deg3) then
- writeln ('Triangle is isosceles')
- else
- writeln ('Triangle is not isosceles');
- end
- else
- writeln ('Triangle does not exist');
- readln
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement