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
'코딩테스트 > [C#] 프로그래머스' 카테고리의 다른 글
[프로그래머스 | C# | Lv.0] 암호 해독 (0) | 2023.09.14 |
---|---|
[프로그래머스 | Lv.0] 인덱스 바꾸기 (0) | 2023.09.13 |
[프로그래머스 | Lv.0] 배열 회전시키기 (0) | 2023.09.12 |
[프로그래머스 | C# | Lv.0] 피자 나눠 먹기 (2) (0) | 2023.09.12 |
[프로그래머스 | C# | Lv.0] 가위 바위 보 (0) | 2023.09.11 |