-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathalienwar.java
More file actions
39 lines (33 loc) · 774 Bytes
/
alienwar.java
File metadata and controls
39 lines (33 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import java.util.Scanner;
public class alienwar {
public static void alien(){
Scanner t = new Scanner(System.in);
int num = t.nextInt();
while (num>0){
long aln=1;
long man=1;
int count1=0;
int count2=0;
int a = t.nextInt();
int b = t.nextInt();
int c = t.nextInt();
int d = t.nextInt();
while (a>1){
a=a/2;
count1=count1 + 1;}
aln = b * count1;
while (c>1){
c=c/2;
count2=count2 + 1;}
man = d * count2;
if (aln > man){
System.out.println("Alien");}
else
{System.out.println("Warrior");}
num =num-1;
}
}
public static void main(String[] args){
alien();
}
}