From 42b7f978e47d289312666adea630d7b2c087d794 Mon Sep 17 00:00:00 2001 From: wjdtjdgns Date: Fri, 30 Jun 2023 15:44:39 +0900 Subject: [PATCH] solve: 5073 --- Baekjoon/5073.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Baekjoon/5073.js diff --git a/Baekjoon/5073.js b/Baekjoon/5073.js new file mode 100644 index 0000000..7e9eaa2 --- /dev/null +++ b/Baekjoon/5073.js @@ -0,0 +1,17 @@ +const input = require('fs').readFileSync('/dev/stdin').toString().trim().split("\n"); + +const result = []; + +for(const v of input) { + const arr = v.split(" ").map(i => +i); + if(arr[0] === 0 && arr[1] === 0 && arr[2] === 0) console.log(result.join("\n")); + arr.sort((a, b) => a - b); + if(arr[2] >= arr[1] + arr[0]) { + result.push("Invalid"); + continue; + } + const set = new Set(arr); + result.push(set.size === 1 ? "Equilateral" : set.size === 2 ? "Isosceles" : "Scalene"); +} + +// 출처 : Baekjoon online judge, https://www.acmicpc.net/problem/5073