1. strana a:
2. strana b:
3. strana c:
Lze sestrojit trojúhelník?  

 
 
trojuhelnik = true;
if (a + b <= c) {
  trojuhelnik = false;  
} else {
  if (a + c <= b) {
    trojuhelnik = false;
  } else {
    if (b + c <= a) {
      trojuhelnik = false;
    }  
  }  
}
if (trojuhelnik) {
  alert("Trojúhelník lze sestrojit.");
} else {
  alert("Trojúhelník NELZE sestrojit.");
}