Determine triangle. Equilateral, isosceles, right-angled or incorrect triangle.
Delphi & Pascal (česká wiki)
Category: Homework in Pascal
Author: Juraj Pupák
Program: Trojuhol.pas
File exe: Trojuhol.exe
Author: Juraj Pupák
Program: Trojuhol.pas
File exe: Trojuhol.exe
Determine triangle. Equilateral, isosceles, right-angled or incorrect triangle.
{ TROJUHOL.PAS } { Zo zadanych dlzok stran urci ci je trojuholnik } { rovnostranny, rovnoramenny, pravouhly, neexistujuci. } { } { Author: Juraj Pupak } { Date : 27.10.2006 http://www.trsek.com } program Trojuholnik; uses crt; var a,b,c : integer; begin clrscr; writeln('Zadaj strany trojuholnika a,b,c'); readln(a); readln(b); readln(c); clrscr; IF (a = b) and (b = c) and (a = c) THEN begin writeln('Rovnostranny'); end; IF ((a = b) and (a <> c)) or ((a = c) and (a <> b)) or ((b = c) and (a <> c)) THEN begin writeln('Rovnoramenny'); end; IF ((a * a) + (b * b) = (c * c)) or ((a * a) + (c * c) = (b * b)) or ((b * b) + (c * c) = (a * a)) THEN begin writeln('Pravouhly'); end; IF (a + b < c) or (a + c < b) or (b + c < a) THEN begin writeln('Neexistuje'); end; readln; end.