코딩테스트/[C#] 프로그래머스
[프로그래머스 | C# | Lv.0] 제곱수 판별하기
냠냠쿠
2023. 9. 13. 19:17
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