슈콩

[SWEA] 홀수일까 짝수일까 본문

Algorithms/SWEA

[SWEA] 홀수일까 짝수일까

shukong 2025. 11. 17. 21:02

 

 

[문제]

https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWWxpEDaAVoDFAW4

 

SW Expert Academy

SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!

swexpertacademy.com

 

 

 

[소스 코드]

import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class Solution {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st;
		int T = Integer.parseInt(br.readLine());
		for(int tc=1;tc<=T;tc++) {
			BigInteger n = new BigInteger(br.readLine());
			BigInteger two = new BigInteger("2");
			String result = "Even";
			if(n.remainder(two).intValue()==1) {
				result = "Odd";
			}
			System.out.println("#"+tc+" "+result);
		}
	}
}

'Algorithms > SWEA' 카테고리의 다른 글

[SWEA] 명진이와 동휘의 숫자 맞추기  (0) 2025.11.18
[SWEA] 유효기간  (0) 2025.11.18
[SWEA] 계산기  (0) 2025.11.17
[SWEA] 반반  (0) 2025.11.17
[SWEA] 구구단 1  (0) 2025.11.17