diff --git a/code_study/Baekjoon/js/10101.js b/code_study/Baekjoon/js/10101.js new file mode 100644 index 0000000..fe119c7 --- /dev/null +++ b/code_study/Baekjoon/js/10101.js @@ -0,0 +1,6 @@ +const [a, b, c] = require("fs").readFileSync(0, "utf8").toString().trim().split('\n').map(Number); + +if(a+b+c !== 180) console.log("Error"); +else if(a===b && a===c) console.log("Equilateral"); +else if(a===b || a===c || b===c) console.log("Isosceles"); +else console.log("Scalene"); \ No newline at end of file diff --git a/code_study/Baekjoon/js/1085.js b/code_study/Baekjoon/js/1085.js new file mode 100644 index 0000000..46bc5a0 --- /dev/null +++ b/code_study/Baekjoon/js/1085.js @@ -0,0 +1,2 @@ +const n = require("fs").readFileSync(0, "utf8").toString().trim().split(' ').map(Number); +console.log(Math.min(n[0],n[1],n[2]-n[0],n[3]-n[1])) \ No newline at end of file diff --git a/code_study/Baekjoon/js/14215.js b/code_study/Baekjoon/js/14215.js new file mode 100644 index 0000000..3086525 --- /dev/null +++ b/code_study/Baekjoon/js/14215.js @@ -0,0 +1,4 @@ +const [a, b, c] = require("fs").readFileSync(0, "utf8").toString().trim().split(' ').map(Number); +const [sum, max] = [a+b+c-Math.max(a,b,c), Math.max(a,b,c)] +if(sum > max) console.log(sum+max); +else console.log(2*sum-1); \ No newline at end of file diff --git a/code_study/Baekjoon/js/15894.js b/code_study/Baekjoon/js/15894.js new file mode 100644 index 0000000..bc2ae3c --- /dev/null +++ b/code_study/Baekjoon/js/15894.js @@ -0,0 +1 @@ +console.log(4*Number(require("fs").readFileSync(0, "utf8").toString().trim())); \ No newline at end of file diff --git a/code_study/Baekjoon/js/27323.js b/code_study/Baekjoon/js/27323.js new file mode 100644 index 0000000..fbff91a --- /dev/null +++ b/code_study/Baekjoon/js/27323.js @@ -0,0 +1,2 @@ +const [a, b] = require("fs").readFileSync(0, "utf8").toString().trim().split('\n').map(Number); +console.log(a*b); \ No newline at end of file diff --git a/code_study/Baekjoon/js/3009.js b/code_study/Baekjoon/js/3009.js new file mode 100644 index 0000000..9276353 --- /dev/null +++ b/code_study/Baekjoon/js/3009.js @@ -0,0 +1,10 @@ +const n = require("fs").readFileSync(0, "utf8").toString().trim().split('\n'); +let x=0, y=0; + +for(let l of n) { + let [a,b] = l.split(" ").map(Number); + x ^= a; + y ^= b; +} + +console.log(x,y); \ No newline at end of file diff --git a/code_study/Baekjoon/js/5073.js b/code_study/Baekjoon/js/5073.js new file mode 100644 index 0000000..399b879 --- /dev/null +++ b/code_study/Baekjoon/js/5073.js @@ -0,0 +1,12 @@ +const n = require("fs").readFileSync(0, "utf8").toString().trim().split('\n'); +n.forEach(s => { + let [a,b,c] = s.split(' ').map(Number); + if(a===0 && b===0 && c===0) return; + else{ + let sum = a + b + c - Math.max(a,b,c); + if(sum<=Math.max(a,b,c)) console.log("Invalid"); + else if(a===b && a===c) console.log("Equilateral"); + else if(a===b || a===c || b===c) console.log("Isosceles"); + else console.log("Scalene"); + } +}); \ No newline at end of file diff --git a/code_study/Baekjoon/js/9063.js b/code_study/Baekjoon/js/9063.js new file mode 100644 index 0000000..8a07f7c --- /dev/null +++ b/code_study/Baekjoon/js/9063.js @@ -0,0 +1,12 @@ +const n = require("fs").readFileSync(0, "utf8").toString().trim().split('\n'); + +let [min_x, min_y] = n[1].split(' ').map(Number); +let [max_x, max_y] = [min_x, min_y]; + +n.slice(2).forEach( s => { + let [x, y] = s.split(' ').map(Number); + [min_x, min_y] = [Math.min(x, min_x), Math.min(y, min_y)]; + [max_x, max_y] = [Math.max(x, max_x), Math.max(y, max_y)]; +}); + +console.log((max_x-min_x)*(max_y-min_y)); \ No newline at end of file