[Programmers] 짝수와 홀수 - 연습문제

동민·2021년 3월 10일
0
// 짝수와 홀수 - 연습문제
public class OddEven {

	public String solution(int num) {
		return (num % 2 == 0) ? "Even" : "Odd";
	}

	public static void main(String[] args) {
		OddEven s = new OddEven();
		System.out.println(s.solution(3));
		System.out.println(s.solution(4));

	}
}
profile
BE Developer

0개의 댓글