2018~2019/Level 1

정수 제곱근 판별 [JavaScript]

전기도둑 2018. 10. 2. 14:55
1
2
3
4
5
6
7
8

function solution(n) { if(Number.isInteger(Math.sqrt(n))) return Math.pow(Math.sqrt(n)+1, 2) else return -1; }


저작자표시 비영리 변경금지 (새창열림)