20250623 baekjoon

This commit is contained in:
songyc macbook 2025-06-23 20:05:18 +09:00
parent 29590cbf41
commit fb8b0b2197
3 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#include <stdio.h>
int main() {
int a,b,c;
while(1) {
scanf("%d %d %d",&a,&b,&c);
if(a==0 && b==0 && c==0) break;
if(a>c) {
a ^= c;
c ^= a;
a ^= c;
}
if(b>c) {
b ^= c;
c ^= b;
b ^= c;
}
if(a*a + b*b == c*c) printf("right\n");
else printf("wrong\n");
}
return 0;
}

View File

@ -0,0 +1,8 @@
const n = require("fs").readFileSync(0,"utf8").toString().trim().split('\n');
n.forEach(num => {
let [a, b, c] = num.split(' ').map(Number).sort((a,b)=>a-b);
if(a===0 && b===0 && c===0) return;
if(c**2 === a**2 + b**2) console.log("right");
else console.log("wrong");
});

View File

@ -0,0 +1,5 @@
while True :
a,b,c = sorted(map(int, input().split()))
if(a==b==c==0) : break
if(a**2+b**2==c**2) : print("right")
else : print("wrong")