-
프로그래머스 - 짝수와 홀수 [자바]Algorithms/- 프로그래머스 2022. 2. 3. 23:23
- 문제 링크 : 짝수와 홀수
정답
class Solution { public String solution(int num) { return num % 2 == 0 ? "Even": "Odd"; } }
분석
- 단순 홀짝 비교
반응형
class Solution {
public String solution(int num) {
return num % 2 == 0 ? "Even": "Odd";
}
}