1. strana a:
2. strana b:
3. strana c:
Je trojúhelník pravoúhlý?  

 
 
trojuhelnik = false;
if (Math.pow(a,2) + Math.pow(b,2) == Math.pow(c,2)) {
  trojuhelnik = true;  
} else {
  if (Math.pow(a,2) + Math.pow(c,2) == Math.pow(b,2)) {
    trojuhelnik = true;
  } else {
    if (Math.pow(b,2) + Math.pow(c,2) == Math.pow(a,2)) {
      trojuhelnik = true;
    }  
  }  
}
if (trojuhelnik) {
  alert("Trojúhelník je pravoúhlý.");
} else {
  alert("Trojúhelník NENÍ pravoúhlý.");
}