20250623 baekjoon
This commit is contained in:
parent
29590cbf41
commit
fb8b0b2197
24
code_study/Baekjoon/c/4153.c
Normal file
24
code_study/Baekjoon/c/4153.c
Normal 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;
|
||||
}
|
||||
8
code_study/Baekjoon/js/4153.js
Normal file
8
code_study/Baekjoon/js/4153.js
Normal 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");
|
||||
});
|
||||
5
code_study/Baekjoon/python/4153.py
Normal file
5
code_study/Baekjoon/python/4153.py
Normal 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")
|
||||
Loading…
x
Reference in New Issue
Block a user