[프로그래머스 | C# | Lv.0] 제곱수 판별하기

728x90

https://school.programmers.co.kr/learn/courses/30/lessons/120909

 

📝 나의 풀이

using System;

public class Solution {
    public int solution(int n) {
        int answer = (Math.Sqrt(n) % 1 == 0 ? 1 : 2);
        return answer;
    }
}
728x90