Problem Link : http://www.codechef.com/problems/NUMGAME
Solution :
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
/**
*
* @author XCoder
*/
class YetAnotherNumberGame {
private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
private static PrintWriter pw = new PrintWriter(System.out);
public static int readIntLine() throws IOException {
return Integer.parseInt(br.readLine());
}
public static void main(String[] args) throws IOException {
int test = readIntLine();
while (test-- > 0) {
int x = readIntLine();
if (x % 2 == 0) {
pw.println("ALICE");
} else {
pw.println("BOB");
}
}
pw.flush();
pw.close();
}
}
No comments:
Post a Comment