슈콩

[SWEA] 승률 비교하기 본문

Algorithms/SWEA

[SWEA] 승률 비교하기

shukong 2025. 11. 18. 20:00

 

 

[문제]

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

 

SW Expert Academy

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

swexpertacademy.com

 

 

 

[소스 코드]

import java.io.*;
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++) {
			st = new StringTokenizer(br.readLine());
			int a = Integer.parseInt(st.nextToken());
			int b = Integer.parseInt(st.nextToken());
			int c = Integer.parseInt(st.nextToken());
			int d = Integer.parseInt(st.nextToken());
			double A = (double)a/b;
			double B = (double)c/d;
			if(A>B) System.out.println("#"+tc+" ALICE");
			else if(B>A) System.out.println("#"+tc+" BOB");
			else System.out.println("#"+tc+" DRAW");
		}
	}
}

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

[SWEA] 색상환  (0) 2025.11.18
[SWEA] 로봇 언어  (0) 2025.11.18
[SWEA] 세상의 모든 팰린드롬 2  (0) 2025.11.18
[SWEA] 테네스의 특별한 소수  (0) 2025.11.18
[SWEA] 성공적인 공연 기획  (0) 2025.11.18