Данный отчёт сгенерирован 10.02.2023 18:21:31 UTC.
HTML версия (этот сайт) сгенерирован 10.02.2023 18:21:38 UTC.
Коммит: [bfeb65b9] add automatic zip creation 10.02.2023 18:21:31
HTML версия (этот сайт) сгенерирован 10.02.2023 18:21:38 UTC.
Коммит: [bfeb65b9] add automatic zip creation 10.02.2023 18:21:31
Задача: Сторони прямокутного трикутника
10.02.2023 18:21:31
Описание: Є три цілих числа. Перевірити, чи ці числа можуть бути довжинами сторін прямокутного трикутника.
Перевірку має виконувати функція triangle, яка отримує три числа і повертає логічне значення.
10.02.2023 18:21:31
Решений: 117
10.02.2023 18:21:31
Сторони прямокутного трикутника
10.02.2023 18:21:31
function triangle(a, b, c){
if (a**2 == b**2 + c**2 || b**2 == a**2 + c**2 || c**2 == b**2 + a**2){
return true
}
}
function triangle(a, b, c){
if (a**2 + b**2 == c**2||a**2 + c**2 == b**2||c**2 + b**2 == a**2){return true}
else{return false}
}
function triangle(a, b, c){
if(a*a + b*b == c*c || a*a + c*c == b*b || b*b +c*c == a*a){
return true;
}
else{
return false;
}
}
function triangle(a, b, c) {
return (a**2 + b**2) == c**2 || (c**2 + b**2) == a**2 || (a**2 + c**2) == b**2
}
function triangle(a, b, c){
function qSum(d, g){
return d*d+g*g;
}
if (a*a == qSum(b, c) || c*c == qSum(a, b) || b*b == qSum(a,c)){
return true;
} else {
return false;
}
}
function triangle(a, b, c){
if (a**2 == b**2 + c**2 || b**2 == a**2 + c**2 || c**2 == a**2 + b**2){
return true
}
else{
return false
}
}
function triangle(a, b, c) {
if (a + b > c && a + c > b && b + c > a) if (a ** 2 + b ** 2 == c ** 2 || a ** 2 + c ** 2 == b ** 2 || c ** 2 + b ** 2 == a ** 2) return true
else return false
}
function triangle ( a, b, c ) {
return ( a * a + b * b == c * c || a * a + c * c == b * b || b * b + c * c == a * a ) ? true : false;
}
function triangle(a, b, c) {
return (c == (a**2+ b**2)**0.5 || a==(b**2+ c**2)**0.5 || b==(a**2+ c**2)**0.5)
}
function triangle(a, b, c){
if ( a*a+b*b===c*c|| b*b+c*c===a*a || a*a+c*c===b*b)
return true;
else return false;
}
function triangle(a, b, c) {
if (a <= 0 || b <= 0 || c <= 0)
return false;
let vec = [ a, b, c ];
vec.sort();
a = vec[0]; b = vec[1]; c = vec[2];
if (a + b <= c)
return false;
let p1 = a, p2 = c - b;
let div = __gcd(p1, p2);
p1 /= div; p2 /= div;
let q1 = c + b, q2 = a;
div = __gcd(q1, q2);
q1 /= div; q2 /= div;
return (p1 == q1 && p2 == q2);
}
function __gcd(a, b)
{
if (b == 0)
return a;
return __gcd(b, a % b);
}
function triangle(a, b, c) {
return a*a + b*b === c*c || a*a + c*c === b*b || c*c + b*b === a*a;
}
function triangle(a, b, c){
if((a+b+c)%12==0)
return true;
}
function triangle(a, b, c) {
if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a){return 1;}else{return 0;}
}
function triangle(a, b, c)
{
return Math.max(a,b,c)**2==a**2+b**2||Math.max(a,b,c)**2==a**2+c**2||Math.max(a,b,c)**2==b**2+c**2;
}
function triangle(a, b, c){
if(a**2 + b**2 == c ** 2 || a**2 + c**2 == b ** 2 || c**2 + b**2 == a ** 2){
return true
}else{
return false
}
}
function triangle(a, b, c){
if(a**2+b**2 ==c**2 || b**2+c**2 ==a**2 || a**2+c**2 ==b**2){
return true
}
return false
}
function triangle(a, b, c){
if((Math.pow(a,2)+Math.pow(b,2)) == Math.pow(c,2))
return true;
if((Math.pow(a,2)+Math.pow(c,2)) == Math.pow(b,2))
return true;
if((Math.pow(c,2)+Math.pow(b,2)) == Math.pow(a,2))
return true;
else
return false;
}
console.log(triangle(3, 4, 5) );
function triangle(a, b, c) {
let mass = [a, b, c];
mass.sort( (x,y) => x-y);
if (mass[0]**2 + mass[1]**2 == mass[2]**2) return true;
else return false;
}
function triangle(a, b, c){
if ((a**2+b**2==c**2) || (b**2+c**2==a**2) || (a**2+c**2==b**2)){
return true
}
return false
}
function triangle(...args){
let max = Math.max(args[0],args[1], args[2]);
args.splice(args.indexOf(max), 1);
return (max ** 2 === args[0] ** 2 + args[1] ** 2);
}
function triangle(a, b, c){
if (a**2 == b**2 + c**2){
return true;
} else if (b**2 == a**2 + c**2){
return true;
} else if (c**2 == a**2 + b**2){
return true;
} else {
return false;
}
}
function triangle ( a, b, c ) {
return ( a * a + b * b == c * c || a * a + c * c == b * b || b * b + c * c == a * a ) ? true : false;
}
function triangle(a, b, c){
return ((a*a+b*b)==c*c||(b*b+c*c)==a*a||(c*c+a*a)==b*b);
}
function triangle(a, b, c){
let result = true;
if (a*a + b*b == c*c || a*a + c*c == b*b || b*b + c*c == a*a){
result = true;
}
else{result = false;}
return result;
}
function triangle(a, b, c) {
[a,b,c] = [a,b,c].sort((x, y) => x - y)
return a*a + b*b == c*c;
}
function triangle(a, b, c) {
if ((a**2 == b**2 + c**2) || (b**2 == a**2 + c**2) || (c**2 == b**2 + a**2)) {
return true;
} else {
return false;
}
}
function triangle(a, b, c){
return a*a + b*b == c*c || b*b + c*c == a*a || a*a + c*c == b*b
}
function triangle(a, b, c)
{
if(a**2 == (b**2) + (c**2) || b**2 == (a**2) + (c**2) || c**2 == (a**2) + (b**2))
{
return true;
}
else
{
return false;
}
}
function triangle(a, b, c){
if (a**2 + b**2 == c**2 || a**2 + c**2 == b**2 || c**2 + b**2 == a**2){
return true;
} else {
return false;
}
}
function triangle(a, b, c) {
if (a + b > c && a + c > b && b + c > a) {
if (a ** 2 + b ** 2 === c ** 2 || a ** 2 + c ** 2 === b ** 2 || b ** 2 + c ** 2 === a ** 2) {
return true;
}
}
return false;
}
function triangle(a, b, c) {
return (Math.pow(a, 2) == Math.pow(b, 2) + Math.pow(c, 2)) || (Math.pow(b, 2) == Math.pow(a, 2) + Math.pow(c, 2)) || (Math.pow(c, 2) == Math.pow(b, 2) + Math.pow(a, 2))? 1:0;
}
function triangle(a, b, c){
let x = Math.min(a, b, c);
let z = Math.max(a, b, c);
let y = a+b+c-x-z;
return x**2+y**2==z**2;
}
function triangle(a, b, c) {
if(a*a + b*b == c*c || a*a + c*c == b*b || c*c + b*b == a*a){
return true;
}
else
return false;
}
function triangle(a, b, c){
if (a*a + b*b == c*c || b*b + c*c == a*a || a*a + c*c == b*b){
return true
}
}
function triangle(a, b, c){
if(a < 1 || b < 1 || c < 1) return false;
let arry = [];
arry[0] = a;
arry[1] = b;
arry[2] = c;
arry.sort();
if (Math.pow(arry[0], 2) + Math.pow(arry[1], 2) == Math.pow(arry[2], 2)) return true;
else false;
}
function triangle(a, b, c)
{
if ( a ** 2 + b ** 2 == c ** 2)
{
return true;
}
if ( b ** 2 + c ** 2 == a ** 2)
{
return true;
}
if ( a ** 2 + c ** 2 == b ** 2)
{
return true;
}
else
return false;
}
function triangle(a, b, c){
a = a**2;
b = b**2;
c = c**2
if (a+b==c || a+c==b||b+c==a){
return true
}
else{
return false
}
}
function triangle(a, b, c){
a=a**2
b=b**2
c=c**2
return a+b===c || c+a===b || b+c===a
}
function triangle(a, b, c) {
let max = a;
if (b > max && b > c) {
max = b;
if ((a*a + c*c) == (max*max)) {
return 1;
} else {
return 0;
}
} else if (c > max) {
max = c;
if ((a*a + b*b) == (max*max)) {
return 1;
} else {
return 0;
}
} else {
if ((b*b + c*c) == (max*max)) {
return 1;
} else {
return 0;
}
}
}
function triangle(a, b, c){
if(a**2+b**2==c**2 || a**2+c**2==b**2 || b**2+c**2==a**2){
return 1
}
return 0
}
function triangle(a, b, c){
if(a**2 + b**2 == c**2 || c**2 + b**2 == a**2|| a**2 + c**2 == b**2){
return true;
}else{
return false;
}
}
function triangle(a, b, c){
if((a**2 + b**2 == c**2) || (a**2 + c**2 == b**2) || (b**2 + c**2 == a**2)) return true;
return false;
}
function triangle(a, b, c) {
let arr = [a,b,c];
for (let i = 0; i < 3; i++){
if (Math.pow(arr[(0 + i) % 3], 2) === Math.pow(arr[(1 + i) % 3], 2) + Math.pow(arr[(2 + i) % 3], 2))
return true;
}
return false
}
function triangle(a, b, c){
return a*a + b*b == c*c || a*a + c*c == b*b || c*c + b*b == a*a;
}
function triangle(a, b, c){
if(a**2+b**2==c**2 || a**2+c**2==b**2 || b**2+c**2==a**2){
return true
}
return false
}
function triangle(a, b, c){return (a*a + b*b)**0.5 == c || (a*a + c*c)**0.5 == b || (b*b + c*c)**0.5 ==a?true:false}
function triangle(a, b, c) {
return (a ** 2 + b ** 2 == c ** 2 || a ** 2 + c ** 2 == b ** 2 || c ** 2 + b ** 2 == a ** 2);
}
function triangle(a, b, c){
if (a*a + b*b == c*c || a*a + c*c == b*b || b*b + c*c == a*a){
return true
}
else{
return false
}
}
function triangle (a, b, c) {
if (a > 0 && b > 0 && c > 0) {
if (a ** 2 + b ** 2 == c ** 2 || b ** 2 + c ** 2 == a ** 2 || a ** 2 + c ** 2 == b ** 2) {
return true
}
} else return false
}
function triangle(a, b, c) {
return (c**2 == a**2 + b**2) || (b**2 == a**2 + c**2) || (a**2 == c**2 + b**2);
}
function triangle(a, b, c){
if(a**2+b**2==c**2||a**2+c**2==b**2||c**2+b**2==a**2) return true;
else return false;
}
function triangle(a, b, c) {
if (a*a==b*b+c*c || b*b==a*a+c*c || c*c==a*a+b*b) {return true} else {return false}
}
function triangle(a, b, c) {
if ((a*a) + (b*b) == (c*c) || (a*a) + (c*c) == (b*b) || (b*b) + (c*c) == (a*a)) {
return true;
} else {return false}
}
function triangle(a, b, c) {
let x = Math.max(a, b, c);
if (x == a)
if (Math.pow(a, 2) == Math.pow(b, 2) + Math.pow(c, 2))
return true;
else
return false;
if (x == b)
if (Math.pow(b, 2) == Math.pow(a, 2) + Math.pow(c, 2))
return true;
else
return false;
if (x == c)
if (Math.pow(c, 2) == Math.pow(b, 2) + Math.pow(a, 2))
return true;
else
return false;
}
function triangle(a, b, c) {
return a*a + b*b === c*c || a*a + c*c === b*b || c*c + b*b === a*a;
}
function triangle(a, b, c) {
if (a**2 + b**2 == c**2){
return true;
}
else if (a**2 + c**2 == b**2){
return true;
}
else if (b**2 + c**2 == a**2){
return true;
}
else {
return false;
}
}
function triangle(a, b, c) {
a = a ** 2;
b = b ** 2;
c = c ** 2;
if(a + b == c)
return true;
if(b + c == a)
return true;
if(c + a == b)
return true;
return false;
}
function triangle(a, b, c) {
if (a + b > c && a + c > b && b + c > a) if (a ** 2 + b ** 2 == c ** 2 || a ** 2 + c ** 2 == b ** 2 || c ** 2 + b ** 2 == a ** 2) return true
else return false
}
function triangle(a, b, c) {
let sides = [a, b, c];
sides.sort((x, y) => x - y);
let [x, y, z] = sides;
return x ** 2 + y ** 2 === z ** 2;
}
function triangle(a, b, c)
{
if(a ** 2 + b ** 2 == c ** 2 || c ** 2 + b ** 2 == a ** 2 || a ** 2 + c ** 2 == b ** 2)
{
return true;
}
else
{
return false;
}
}
function triangle(a, b, c){
if (c**2 == a**2 + b**2 ||a**2 == b**2 + c**2 ||b**2 == a**2 + c**2 )
{
return true
}
else false
}
function triangle(a, b, c){
return((a*a+b*b)==c*c||(b*b+c*c)==a*a||(c*c+a*a)==b*b);
}
function triangle(a, b, c) {
let sides=[a,b,c].sort();
return sides[2]*sides[2]==sides[0]*sides[0]+sides[1]*sides[1]? true:false;
}
//END
console.log(triangle(5, 4, 3) ); // true
console.log(triangle(3, 3, 5) ); // false
function triangle(a, b, c) {
let m = a, s; // m - гипотенуза, s - сумма квадратов катетов
for(x of [b, c]) {
if (x > m)
m = x;
}
if(m == a) {
s = b**2 + c**2;
} else if(m == b) {
s = a**2 + c**2;
} else {
s = a**2 + b**2;
}
return m**2 == s;
}
function triangle(a, b, c)
{
if(a**2+b**2==c**2) return true;
if(a**2+c**2==b**2) return true;
if(b**2+c**2==a**2) return true
return false;
}
function triangle(a, b, c){
let arr = [a,b,c].sort();
return Math.pow(arr[2], 2) == Math.pow(arr[1], 2) + Math.pow(arr[0], 2)
}
function triangle(a, b, c)
{
if((a**2 == b**2 + c**2)||(b**2 == c**2 + a**2)||(c**2 == a**2 + b**2))
{
return true
}
else
{
return false
}
}
function triangle(a, b, c) {
return a*a+b*b==c*c || a*a+c*c==b*b || b*b+c*c==a*a
}
function triangle(a, b, c)
{
s = a**2 + b**2 == c**2 || a**2 + c**2 == b**2 || b**2 + c**2 == a**2
return s
}
function triangle(a, b, c){
return (a*a == b*b + c*c || b*b == a*a + c*c || c*c == a*a + b*b)
}
function triangle(a, b, c){
if((a+b+c)%12 ==0) {
return true
}
else{
return false
}
}
function triangle(a, b, c) {
if (a**2 + b**2 === c**2 || c**2 + b**2 === a**2 || c**2 + a**2 === b**2)
return true;
else return false;
}
function triangle(a, b, c){
if (a ** 2 + b ** 2 == c ** 2 || b ** 2 + c ** 2 == a ** 2 || a ** 2 + c ** 2 == b ** 2)
return true
else
return false
}
function triangle(a, b, c)
{
return (a * a + b * b == c * c) || (a * a + c * c == b * b) || (c * c + b * b == a * a);
}
function triangle(a, b, c) {
return a*a + b*b === c*c || a*a + c*c === b*b || c*c + b*b === a*a;
}
function triangle(a, b, c) {
if((a + b + c) % 12 == 0)
return true;
else
return false;
}
function triangle(a, b, c){return (a**2 + b**2)**0.5 == c ||(a**2 + c**2)**0.5 == b || (b**2 + c**2)**0.5 == a?true:false}
function triangle(a, b, c) {
return (a**2 + b**2 == c**2 ||a**2 + c**2 == b**2 || c**2 + b**2 == a**2);
}
function triangle(a, b, c){
if(a**2 + b**2 == c**2) return true;
if(b**2 + c**2 == a**2) return true;
if(a**2 + c**2 == b**2) return true;
return false
}
function triangle(a, b, c){
[a,b,c] = [a,b,c].sort()
return Math.round(Math.asin(a / c) * 100) / 100 == Math.round(Math.acos(b / c) * 100) / 100;
}
function triangle(a, b, c){
let z = Math.max(a,b,c)
let x = 0
let d = 0
if (z==a){
x=b
d=c
}else if(z==b){
x=a
d=c
}else{
x=a
d=b
}
if(((a+b>c)&&(a+c>b)&&(b+c>a)) && ((z**2)==x**2+d**2)){
return 1
}else{
return 0
}
}
function triangle(a, b, c) {
return a*a + b*b === c*c || a*a + c*c === b*b || c*c + b*b === a*a;
}
function triangle(a, b, c) {
if (a + b > c && a + c > b && b + c > a) if (a ** 2 + b ** 2 == c ** 2 || a ** 2 + c ** 2 == b ** 2 || c ** 2 + b ** 2 == a ** 2) return true
else return false
}
function triangle(a, b, c) {
let result = false;
if (a + b < c) {return false}
if (a + c < b) {return false}
if (c + b < a) {return false}
if(a**2 + b**2 == c**2){return true}
if(a**2 + c**2 == b**2){return true}
if(c**2 + b**2 == a**2){return true}
return false
}
function triangle(a, b, c) {
let max = Math.max(a, b, c);
let min = Math.min(a, b, c);
let aver = a + b + c - max - min;
if(max**2 == aver**2 + min**2)
return true;
return false;
}
function triangle(a, b, c) {
if (a*a==b*b+c*c || b*b==a*a+c*c || c*c==a*a+b*b) {return true} else {return false}
}
function triangle(a, b, c){
let h=Math.max(a,b,c)
let k1=Math.min(a,b,c)
let k2=a+b+c-h-k1
return Math.pow(h,2)==Math.pow(k1,2)+Math.pow(k2,2)
}
function triangle(a, b, c){
if (a**2+b**2==c**2 || a**2+c**2==b**2 || b**2+c**2==a**2){
return true
}
else{
return false
}
}
function triangle(a, b, c){
if (a**2 + b**2 == c**2 || a**2 + c**2 == b**2 || c**2 + b**2 == a**2){
return true;
} else {
return false;
}
}
function triangle(a, b, c){
let box;
if (a>b) {box=a; a=b; b=box}
if (b>c) {box=b; b=c; c=box}
if (c>b) {box=a; a=b; b=box}
if (a**2+b**2==c**2){ return 1} else return 0;
}
function triangle(a, b, c){
if(Math.pow(a, 2) === Math.pow(b, 2) + Math.pow(c, 2) || Math.pow(b, 2) === Math.pow(a, 2) + Math.pow(c, 2) || Math.pow(c, 2) === Math.pow(b, 2) + Math.pow(a, 2)){
return true;
}
return false;
}
function triangle(a, b, c){
if (c**2 == a**2 + b**2){
return true
} else if (b**2 == a**2 + c**2){
return true
} else if (a**2 == c**2 + b**2){
return true
} else {
return false
}
}
function triangle(a, b, c){
if(a > b && a > c){
return a**2 == b**2 + c**2;
}else if(b > a && b > c){
return b**2 == a**2 + c**2;
}else if(c > a && c > b){
return c**2 == a**2 + b**2;
}else {
return false;
}
}
function triangle(a, b, c){
if (a**2+b**2==c**2 || a**2+c**2==b**2 || b**2+c**2==a**2){
return true;
}
else
return false;
}
function triangle(a, b, c)
{
if(c**2 == a**2 + b**2 || a**2 == c**2 + b**2 || b**2 == c**2 + a**2)
{
return true;
}
else
{
return false;
}
}
function triangle(a, b, c) {
if (a * a + b * b >= c * c && a * a + c * c >= b * b && b * b + c * c >= a * a) {
return true;
}
return false;
}
function triangle(a, b, c){
if(c**2 == a**2 + b**2 || b**2 == a**2 + c**2||a**2 == c**2 + b**2){
return true;
}else{
return false;
}
}
function triangle(a, b, c) {
return Math.max(a,b,c)**2 == Math.min(a,b,c)**2 + midNum(a,b,c)**2 ? true : false;
}
function midNum(a,b,c){
if(Math.max(a,b,c) == a){
if(Math.max(b,c) == b){
return b;
}else {
return c;
}
}else if(Math.max(a,b,c) == b){
if(Math.max(a,c) == c){
return c;
}else {
return a;
}
}else {
if(Math.max(a,b) == a){
return c;
}else {
return b;
}
}
}
function triangle(a, b, c)
{
return a*a+b*b==c*c || a*a+c*c==b*b || b*b+c*c==a*a
}
function triangle(a, b, c){
let s= ( a**2=== b**2 + c**2 ) || (b**2=== a**2 + c**2) || (c**2=== b**2 + a**2)
return s
}
function triangle(a, b, c) {
if (a <= 0 || b <= 0 || c <= 0) {
return false;
}
if (a + b > c && a + c > b && b + c > a) {
if (a ** 2 + b ** 2 == c ** 2 || a ** 2 + c ** 2 == b ** 2 || b ** 2 + c ** 2 == a ** 2) {
return true;
}
}
return false;
}
function triangle(a, b, c) {
if (a**2 + b**2 == c**2) return true;
if (c**2 + b**2 == a**2) return true;
if (a**2 + c**2 == b**2) return true;
return false;
}
function triangle(a, b, c){
if(a**2+b**2 == c**2 || a**2+c**2 == b**2 || c**2+b**2 == a**2){
return true
}
else return false
}
function triangle(a, b, c){
return a**2 == b**2 + c**2 || b**2 == a**2 + c**2 || c**2 == b**2 + a**2
}
function triangle(a, b, c) {
return (a**2+b**2==c**2 || a**2+c**2==b**2 || b**2+c**2==a**2);
}
function triangle(a,b,c){
if(c == Math.sqrt(a**2 + b**2)||a == Math.sqrt(c**2 + b**2)||b == Math.sqrt(c**2 +a**2)){
return true;}
else{
return false;
}
}
console.log(triangle() );
function triangle(a, b, c){
let arr = [a,b,c].sort((a, b) => a - b);
if(arr[0] ** 2 + arr[1] ** 2 == arr[2] ** 2) return true;
return false;
}
function triangle(a, b, c) {
let x = a ** 2;
let y = b ** 2;
let z = c ** 2;
if(x == y + z || y == x + z || z == x + y)
return true;
else
return false;
}
function triangle(a, b, c){
if(a*a==b*b+c*c||a*a+b*b==c*c||b*b==a*a+c*c){
return true;
}
else{return false}
}
function triangle(a, b, c)
{
return (a+b+c)%12==0;
}
function triangle(a, b, c){
let arr = [];
arr.push(a,b,c);
let arr2 = arr.sort();
if(arr2[2]**2 == arr2[1]**2 + arr2[0]**2){
return true;
} else{
return false;
}
}
function triangle(a, b, c) {
let x = a*a + b*b == c*c || a*a + c*c == b*b || c*c + b*b == a*a;
return x
}
function s(h, k1, k2) {
return h**2 === k1 ** 2 + k2 ** 2
}
function triangle(a, b, c) {
return s(a, b, c) || s(b, a, c) || s(c, a, b)
}
function triangle(a, b, c) {
return a**2 == b**2 + c**2 || b**2 == a**2 + c**2 || c**2 == b**2 + a**2;
}
function triangle(a, b, c)
{
if (a**2 == b**2 + c**2 || b**2 == a**2 + c**2 || c**2 == a**2 + b**2)
return 1;
return 0;
}
function triangle(a, b, c) {
if(a*a==b*b+c*c || b*b==a*a+c*c || c*c==b*b+a*a)
return true;
else
return false;
}
if (a**2 == b**2 + c**2 || b**2 == a**2 + c**2 || c**2 == b**2 + a**2){
return true
}
}
if (a**2 + b**2 == c**2||a**2 + c**2 == b**2||c**2 + b**2 == a**2){return true}
else{return false}
}
if(a*a + b*b == c*c || a*a + c*c == b*b || b*b +c*c == a*a){
return true;
}
else{
return false;
}
}
return (a**2 + b**2) == c**2 || (c**2 + b**2) == a**2 || (a**2 + c**2) == b**2
}
function qSum(d, g){
return d*d+g*g;
}
if (a*a == qSum(b, c) || c*c == qSum(a, b) || b*b == qSum(a,c)){
return true;
} else {
return false;
}
}
if (a**2 == b**2 + c**2 || b**2 == a**2 + c**2 || c**2 == a**2 + b**2){
return true
}
else{
return false
}
}
if (a + b > c && a + c > b && b + c > a) if (a ** 2 + b ** 2 == c ** 2 || a ** 2 + c ** 2 == b ** 2 || c ** 2 + b ** 2 == a ** 2) return true
else return false
}
return ( a * a + b * b == c * c || a * a + c * c == b * b || b * b + c * c == a * a ) ? true : false;
}
return (c == (a**2+ b**2)**0.5 || a==(b**2+ c**2)**0.5 || b==(a**2+ c**2)**0.5)
}
if ( a*a+b*b===c*c|| b*b+c*c===a*a || a*a+c*c===b*b)
return true;
else return false;
}
if (a <= 0 || b <= 0 || c <= 0)
return false;
let vec = [ a, b, c ];
vec.sort();
a = vec[0]; b = vec[1]; c = vec[2];
if (a + b <= c)
return false;
let p1 = a, p2 = c - b;
let div = __gcd(p1, p2);
p1 /= div; p2 /= div;
let q1 = c + b, q2 = a;
div = __gcd(q1, q2);
q1 /= div; q2 /= div;
return (p1 == q1 && p2 == q2);
}
function __gcd(a, b)
{
if (b == 0)
return a;
return __gcd(b, a % b);
}
return a*a + b*b === c*c || a*a + c*c === b*b || c*c + b*b === a*a;
}
if((a+b+c)%12==0)
return true;
}
if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a){return 1;}else{return 0;}
}
{
return Math.max(a,b,c)**2==a**2+b**2||Math.max(a,b,c)**2==a**2+c**2||Math.max(a,b,c)**2==b**2+c**2;
}
if(a**2 + b**2 == c ** 2 || a**2 + c**2 == b ** 2 || c**2 + b**2 == a ** 2){
return true
}else{
return false
}
}
if(a**2+b**2 ==c**2 || b**2+c**2 ==a**2 || a**2+c**2 ==b**2){
return true
}
return false
}
if((Math.pow(a,2)+Math.pow(b,2)) == Math.pow(c,2))
return true;
if((Math.pow(a,2)+Math.pow(c,2)) == Math.pow(b,2))
return true;
if((Math.pow(c,2)+Math.pow(b,2)) == Math.pow(a,2))
return true;
else
return false;
}
console.log(triangle(3, 4, 5) );
let mass = [a, b, c];
mass.sort( (x,y) => x-y);
if (mass[0]**2 + mass[1]**2 == mass[2]**2) return true;
else return false;
}
if ((a**2+b**2==c**2) || (b**2+c**2==a**2) || (a**2+c**2==b**2)){
return true
}
return false
}
let max = Math.max(args[0],args[1], args[2]);
args.splice(args.indexOf(max), 1);
return (max ** 2 === args[0] ** 2 + args[1] ** 2);
}
if (a**2 == b**2 + c**2){
return true;
} else if (b**2 == a**2 + c**2){
return true;
} else if (c**2 == a**2 + b**2){
return true;
} else {
return false;
}
}
return ( a * a + b * b == c * c || a * a + c * c == b * b || b * b + c * c == a * a ) ? true : false;
}
return ((a*a+b*b)==c*c||(b*b+c*c)==a*a||(c*c+a*a)==b*b);
}
let result = true;
if (a*a + b*b == c*c || a*a + c*c == b*b || b*b + c*c == a*a){
result = true;
}
else{result = false;}
return result;
}
[a,b,c] = [a,b,c].sort((x, y) => x - y)
return a*a + b*b == c*c;
}
if ((a**2 == b**2 + c**2) || (b**2 == a**2 + c**2) || (c**2 == b**2 + a**2)) {
return true;
} else {
return false;
}
}
return a*a + b*b == c*c || b*b + c*c == a*a || a*a + c*c == b*b
}
{
if(a**2 == (b**2) + (c**2) || b**2 == (a**2) + (c**2) || c**2 == (a**2) + (b**2))
{
return true;
}
else
{
return false;
}
}
if (a**2 + b**2 == c**2 || a**2 + c**2 == b**2 || c**2 + b**2 == a**2){
return true;
} else {
return false;
}
}
if (a + b > c && a + c > b && b + c > a) {
if (a ** 2 + b ** 2 === c ** 2 || a ** 2 + c ** 2 === b ** 2 || b ** 2 + c ** 2 === a ** 2) {
return true;
}
}
return false;
}
return (Math.pow(a, 2) == Math.pow(b, 2) + Math.pow(c, 2)) || (Math.pow(b, 2) == Math.pow(a, 2) + Math.pow(c, 2)) || (Math.pow(c, 2) == Math.pow(b, 2) + Math.pow(a, 2))? 1:0;
}
let x = Math.min(a, b, c);
let z = Math.max(a, b, c);
let y = a+b+c-x-z;
return x**2+y**2==z**2;
}
if(a*a + b*b == c*c || a*a + c*c == b*b || c*c + b*b == a*a){
return true;
}
else
return false;
}
if (a*a + b*b == c*c || b*b + c*c == a*a || a*a + c*c == b*b){
return true
}
}
if(a < 1 || b < 1 || c < 1) return false;
let arry = [];
arry[0] = a;
arry[1] = b;
arry[2] = c;
arry.sort();
if (Math.pow(arry[0], 2) + Math.pow(arry[1], 2) == Math.pow(arry[2], 2)) return true;
else false;
}
{
if ( a ** 2 + b ** 2 == c ** 2)
{
return true;
}
if ( b ** 2 + c ** 2 == a ** 2)
{
return true;
}
if ( a ** 2 + c ** 2 == b ** 2)
{
return true;
}
else
return false;
}
a = a**2;
b = b**2;
c = c**2
if (a+b==c || a+c==b||b+c==a){
return true
}
else{
return false
}
}
a=a**2
b=b**2
c=c**2
return a+b===c || c+a===b || b+c===a
}
let max = a;
if (b > max && b > c) {
max = b;
if ((a*a + c*c) == (max*max)) {
return 1;
} else {
return 0;
}
} else if (c > max) {
max = c;
if ((a*a + b*b) == (max*max)) {
return 1;
} else {
return 0;
}
} else {
if ((b*b + c*c) == (max*max)) {
return 1;
} else {
return 0;
}
}
}
if(a**2+b**2==c**2 || a**2+c**2==b**2 || b**2+c**2==a**2){
return 1
}
return 0
}
if(a**2 + b**2 == c**2 || c**2 + b**2 == a**2|| a**2 + c**2 == b**2){
return true;
}else{
return false;
}
}
if((a**2 + b**2 == c**2) || (a**2 + c**2 == b**2) || (b**2 + c**2 == a**2)) return true;
return false;
}
let arr = [a,b,c];
for (let i = 0; i < 3; i++){
if (Math.pow(arr[(0 + i) % 3], 2) === Math.pow(arr[(1 + i) % 3], 2) + Math.pow(arr[(2 + i) % 3], 2))
return true;
}
return false
}
return a*a + b*b == c*c || a*a + c*c == b*b || c*c + b*b == a*a;
}
if(a**2+b**2==c**2 || a**2+c**2==b**2 || b**2+c**2==a**2){
return true
}
return false
}
return (a ** 2 + b ** 2 == c ** 2 || a ** 2 + c ** 2 == b ** 2 || c ** 2 + b ** 2 == a ** 2);
}
if (a*a + b*b == c*c || a*a + c*c == b*b || b*b + c*c == a*a){
return true
}
else{
return false
}
}
if (a > 0 && b > 0 && c > 0) {
if (a ** 2 + b ** 2 == c ** 2 || b ** 2 + c ** 2 == a ** 2 || a ** 2 + c ** 2 == b ** 2) {
return true
}
} else return false
}
return (c**2 == a**2 + b**2) || (b**2 == a**2 + c**2) || (a**2 == c**2 + b**2);
}
if(a**2+b**2==c**2||a**2+c**2==b**2||c**2+b**2==a**2) return true;
else return false;
}
if (a*a==b*b+c*c || b*b==a*a+c*c || c*c==a*a+b*b) {return true} else {return false}
}
if ((a*a) + (b*b) == (c*c) || (a*a) + (c*c) == (b*b) || (b*b) + (c*c) == (a*a)) {
return true;
} else {return false}
}
let x = Math.max(a, b, c);
if (x == a)
if (Math.pow(a, 2) == Math.pow(b, 2) + Math.pow(c, 2))
return true;
else
return false;
if (x == b)
if (Math.pow(b, 2) == Math.pow(a, 2) + Math.pow(c, 2))
return true;
else
return false;
if (x == c)
if (Math.pow(c, 2) == Math.pow(b, 2) + Math.pow(a, 2))
return true;
else
return false;
}
return a*a + b*b === c*c || a*a + c*c === b*b || c*c + b*b === a*a;
}
if (a**2 + b**2 == c**2){
return true;
}
else if (a**2 + c**2 == b**2){
return true;
}
else if (b**2 + c**2 == a**2){
return true;
}
else {
return false;
}
}
a = a ** 2;
b = b ** 2;
c = c ** 2;
if(a + b == c)
return true;
if(b + c == a)
return true;
if(c + a == b)
return true;
return false;
}
if (a + b > c && a + c > b && b + c > a) if (a ** 2 + b ** 2 == c ** 2 || a ** 2 + c ** 2 == b ** 2 || c ** 2 + b ** 2 == a ** 2) return true
else return false
}
let sides = [a, b, c];
sides.sort((x, y) => x - y);
let [x, y, z] = sides;
return x ** 2 + y ** 2 === z ** 2;
}
{
if(a ** 2 + b ** 2 == c ** 2 || c ** 2 + b ** 2 == a ** 2 || a ** 2 + c ** 2 == b ** 2)
{
return true;
}
else
{
return false;
}
}
if (c**2 == a**2 + b**2 ||a**2 == b**2 + c**2 ||b**2 == a**2 + c**2 )
{
return true
}
else false
}
return((a*a+b*b)==c*c||(b*b+c*c)==a*a||(c*c+a*a)==b*b);
}
let sides=[a,b,c].sort();
return sides[2]*sides[2]==sides[0]*sides[0]+sides[1]*sides[1]? true:false;
}
//END
console.log(triangle(5, 4, 3) ); // true
console.log(triangle(3, 3, 5) ); // false
let m = a, s; // m - гипотенуза, s - сумма квадратов катетов
for(x of [b, c]) {
if (x > m)
m = x;
}
if(m == a) {
s = b**2 + c**2;
} else if(m == b) {
s = a**2 + c**2;
} else {
s = a**2 + b**2;
}
return m**2 == s;
}
{
if(a**2+b**2==c**2) return true;
if(a**2+c**2==b**2) return true;
if(b**2+c**2==a**2) return true
return false;
}
let arr = [a,b,c].sort();
return Math.pow(arr[2], 2) == Math.pow(arr[1], 2) + Math.pow(arr[0], 2)
}
{
if((a**2 == b**2 + c**2)||(b**2 == c**2 + a**2)||(c**2 == a**2 + b**2))
{
return true
}
else
{
return false
}
}
return a*a+b*b==c*c || a*a+c*c==b*b || b*b+c*c==a*a
}
{
s = a**2 + b**2 == c**2 || a**2 + c**2 == b**2 || b**2 + c**2 == a**2
return s
}
return (a*a == b*b + c*c || b*b == a*a + c*c || c*c == a*a + b*b)
}
if((a+b+c)%12 ==0) {
return true
}
else{
return false
}
}
if (a**2 + b**2 === c**2 || c**2 + b**2 === a**2 || c**2 + a**2 === b**2)
return true;
else return false;
}
if (a ** 2 + b ** 2 == c ** 2 || b ** 2 + c ** 2 == a ** 2 || a ** 2 + c ** 2 == b ** 2)
return true
else
return false
}
{
return (a * a + b * b == c * c) || (a * a + c * c == b * b) || (c * c + b * b == a * a);
}
return a*a + b*b === c*c || a*a + c*c === b*b || c*c + b*b === a*a;
}
if((a + b + c) % 12 == 0)
return true;
else
return false;
}
return (a**2 + b**2 == c**2 ||a**2 + c**2 == b**2 || c**2 + b**2 == a**2);
}
if(a**2 + b**2 == c**2) return true;
if(b**2 + c**2 == a**2) return true;
if(a**2 + c**2 == b**2) return true;
return false
}
[a,b,c] = [a,b,c].sort()
return Math.round(Math.asin(a / c) * 100) / 100 == Math.round(Math.acos(b / c) * 100) / 100;
}
let z = Math.max(a,b,c)
let x = 0
let d = 0
if (z==a){
x=b
d=c
}else if(z==b){
x=a
d=c
}else{
x=a
d=b
}
if(((a+b>c)&&(a+c>b)&&(b+c>a)) && ((z**2)==x**2+d**2)){
return 1
}else{
return 0
}
}
return a*a + b*b === c*c || a*a + c*c === b*b || c*c + b*b === a*a;
}
if (a + b > c && a + c > b && b + c > a) if (a ** 2 + b ** 2 == c ** 2 || a ** 2 + c ** 2 == b ** 2 || c ** 2 + b ** 2 == a ** 2) return true
else return false
}
let result = false;
if (a + b < c) {return false}
if (a + c < b) {return false}
if (c + b < a) {return false}
if(a**2 + b**2 == c**2){return true}
if(a**2 + c**2 == b**2){return true}
if(c**2 + b**2 == a**2){return true}
return false
}
let max = Math.max(a, b, c);
let min = Math.min(a, b, c);
let aver = a + b + c - max - min;
if(max**2 == aver**2 + min**2)
return true;
return false;
}
if (a*a==b*b+c*c || b*b==a*a+c*c || c*c==a*a+b*b) {return true} else {return false}
}
let h=Math.max(a,b,c)
let k1=Math.min(a,b,c)
let k2=a+b+c-h-k1
return Math.pow(h,2)==Math.pow(k1,2)+Math.pow(k2,2)
}
if (a**2+b**2==c**2 || a**2+c**2==b**2 || b**2+c**2==a**2){
return true
}
else{
return false
}
}
if (a**2 + b**2 == c**2 || a**2 + c**2 == b**2 || c**2 + b**2 == a**2){
return true;
} else {
return false;
}
}
let box;
if (a>b) {box=a; a=b; b=box}
if (b>c) {box=b; b=c; c=box}
if (c>b) {box=a; a=b; b=box}
if (a**2+b**2==c**2){ return 1} else return 0;
}
if(Math.pow(a, 2) === Math.pow(b, 2) + Math.pow(c, 2) || Math.pow(b, 2) === Math.pow(a, 2) + Math.pow(c, 2) || Math.pow(c, 2) === Math.pow(b, 2) + Math.pow(a, 2)){
return true;
}
return false;
}
if (c**2 == a**2 + b**2){
return true
} else if (b**2 == a**2 + c**2){
return true
} else if (a**2 == c**2 + b**2){
return true
} else {
return false
}
}
if(a > b && a > c){
return a**2 == b**2 + c**2;
}else if(b > a && b > c){
return b**2 == a**2 + c**2;
}else if(c > a && c > b){
return c**2 == a**2 + b**2;
}else {
return false;
}
}
if (a**2+b**2==c**2 || a**2+c**2==b**2 || b**2+c**2==a**2){
return true;
}
else
return false;
}
{
if(c**2 == a**2 + b**2 || a**2 == c**2 + b**2 || b**2 == c**2 + a**2)
{
return true;
}
else
{
return false;
}
}
if (a * a + b * b >= c * c && a * a + c * c >= b * b && b * b + c * c >= a * a) {
return true;
}
return false;
}
if(c**2 == a**2 + b**2 || b**2 == a**2 + c**2||a**2 == c**2 + b**2){
return true;
}else{
return false;
}
}
return Math.max(a,b,c)**2 == Math.min(a,b,c)**2 + midNum(a,b,c)**2 ? true : false;
}
function midNum(a,b,c){
if(Math.max(a,b,c) == a){
if(Math.max(b,c) == b){
return b;
}else {
return c;
}
}else if(Math.max(a,b,c) == b){
if(Math.max(a,c) == c){
return c;
}else {
return a;
}
}else {
if(Math.max(a,b) == a){
return c;
}else {
return b;
}
}
}
{
return a*a+b*b==c*c || a*a+c*c==b*b || b*b+c*c==a*a
}
let s= ( a**2=== b**2 + c**2 ) || (b**2=== a**2 + c**2) || (c**2=== b**2 + a**2)
return s
}
if (a <= 0 || b <= 0 || c <= 0) {
return false;
}
if (a + b > c && a + c > b && b + c > a) {
if (a ** 2 + b ** 2 == c ** 2 || a ** 2 + c ** 2 == b ** 2 || b ** 2 + c ** 2 == a ** 2) {
return true;
}
}
return false;
}
if (a**2 + b**2 == c**2) return true;
if (c**2 + b**2 == a**2) return true;
if (a**2 + c**2 == b**2) return true;
return false;
}
if(a**2+b**2 == c**2 || a**2+c**2 == b**2 || c**2+b**2 == a**2){
return true
}
else return false
}
return a**2 == b**2 + c**2 || b**2 == a**2 + c**2 || c**2 == b**2 + a**2
}
return (a**2+b**2==c**2 || a**2+c**2==b**2 || b**2+c**2==a**2);
}
if(c == Math.sqrt(a**2 + b**2)||a == Math.sqrt(c**2 + b**2)||b == Math.sqrt(c**2 +a**2)){
return true;}
else{
return false;
}
}
console.log(triangle() );
let arr = [a,b,c].sort((a, b) => a - b);
if(arr[0] ** 2 + arr[1] ** 2 == arr[2] ** 2) return true;
return false;
}
let x = a ** 2;
let y = b ** 2;
let z = c ** 2;
if(x == y + z || y == x + z || z == x + y)
return true;
else
return false;
}
if(a*a==b*b+c*c||a*a+b*b==c*c||b*b==a*a+c*c){
return true;
}
else{return false}
}
{
return (a+b+c)%12==0;
}
let arr = [];
arr.push(a,b,c);
let arr2 = arr.sort();
if(arr2[2]**2 == arr2[1]**2 + arr2[0]**2){
return true;
} else{
return false;
}
}
let x = a*a + b*b == c*c || a*a + c*c == b*b || c*c + b*b == a*a;
return x
}
return h**2 === k1 ** 2 + k2 ** 2
}
function triangle(a, b, c) {
return s(a, b, c) || s(b, a, c) || s(c, a, b)
}
return a**2 == b**2 + c**2 || b**2 == a**2 + c**2 || c**2 == b**2 + a**2;
}
{
if (a**2 == b**2 + c**2 || b**2 == a**2 + c**2 || c**2 == a**2 + b**2)
return 1;
return 0;
}
if(a*a==b*b+c*c || b*b==a*a+c*c || c*c==b*b+a*a)
return true;
else
return false;
}