diff --git a/code_study/Baekjoon/c/4153.c b/code_study/Baekjoon/c/4153.c new file mode 100644 index 0000000..e31e8dc --- /dev/null +++ b/code_study/Baekjoon/c/4153.c @@ -0,0 +1,24 @@ +#include + +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; +} \ No newline at end of file diff --git a/code_study/Baekjoon/js/4153.js b/code_study/Baekjoon/js/4153.js new file mode 100644 index 0000000..35da9e6 --- /dev/null +++ b/code_study/Baekjoon/js/4153.js @@ -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"); +}); \ No newline at end of file diff --git a/code_study/Baekjoon/python/4153.py b/code_study/Baekjoon/python/4153.py new file mode 100644 index 0000000..fc25882 --- /dev/null +++ b/code_study/Baekjoon/python/4153.py @@ -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") \ No newline at end of file