Skip to content

Commit

Permalink
solve: 5073
Browse files Browse the repository at this point in the history
  • Loading branch information
wjdtjdgns committed Jun 30, 2023
1 parent 8984449 commit 42b7f97
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Baekjoon/5073.js
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 42b7f97

Please sign in to comment.