Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 331 Bytes

File metadata and controls

13 lines (11 loc) · 331 Bytes

프로그래머스 Level1 : 연습문제 정수 제곱근 판별

class Solution {
    public long solution(long n) {
        long answer = 0;
        if(Math.sqrt(n)%1 == 0) return (long)Math.pow(Math.sqrt(n)+1,2);
        else return -1;
    }
}