Toto je starší verze dokumentu!
Zadání
Řešení
function isRound(number){ return Math.round(number) == number } function solvePythagorean(a, b){ return Math.sqrt( a*a + b*b ) } function isPythagorean(a, b){ var c = solvePythagorean(a, b) return isRound(a) && isRound(b) && isRound(c) } for(var x=1;x<=100;x++){ for(var y=1;y<=100;y++){ if(isPythagorean(x,y)){ console.log("a="+x+",b="+y +",c="+ solvePythagorean(x,y)) } } }