[프로그래머스] 짝수와 홀수

num이 짝수면 Even 홀수면 Odd

1
2
3
4
5
6
7
8
9
10
11
12
class Solution {
public String solution(int num) {
String answer = "";
if (num % 2 == 0){
answer = "Even";
}
else{
answer = "Odd";
}
return answer;
}
}
Author

MoonDoni

Posted on

2020-01-26

Updated on

2020-01-26

Licensed under

댓글