๐ ์ฝ๋ฉํ
์คํธ/๋ฐฑ์ค & ํ๋ก๊ทธ๋๋จธ์ค
[SWEA][JAVA]D3 : ์น๋ฅ ๋น๊ตํ๊ธฐ
deep_lee
2022. 11. 15. 13:51
SW Expert Academy
SW ํ๋ก๊ทธ๋๋ฐ ์ญ๋ ๊ฐํ์ ๋์์ด ๋๋ ๋ค์ํ ํ์ต ์ปจํ ์ธ ๋ฅผ ํ์ธํ์ธ์!
swexpertacademy.com
์์ ๋ฒ์๊ฐ ์์์ ๊ทธ๋ฅ ์ต์๊ณต๋ฐฐ์๋ฅผ ๊ตฌํด์ ๊ทธ๋๋ก ์ ์ถ๋ ฅํ๋๋ฐ ..
์ด๊ฒ ์ ์ ๋ต๋ฅ 40ํ๋ก์ง ..
import java.util.Scanner;
class Solution{
public static void main(String args[]) throws Exception{
Scanner kb = new Scanner(System.in);
int T = kb.nextInt();
for (int t = 1; t <= T; t++) {
int a=kb.nextInt();
int b=kb.nextInt();
int c=kb.nextInt();
int d=kb.nextInt();
int temp=b*d;
int A=temp/b;
int B=temp/d;
a*=A;
c*=B;
int max=Math.max(a,c);
if(max==a&&max==c) System.out.println("#"+t+" "+"DRAW");
else if(max==a) System.out.println("#"+t+" "+"ALICE");
else System.out.println("#"+t+" "+"BOB");
}
}
}