View Code of Problem 13

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int count = 1;
		while(sc.hasNext()) {
			int h = sc.nextInt();
			int a = sc.nextInt();
			int b = sc.nextInt();
			int k = sc.nextInt();
			int x = a - b;
			if(h <= a) {
				System.out.println("Case #"+ count++ + ": White win");
			} else {
				if(x <= 0) {
					System.out.println("Case #" + count++ +": Unknow");
				}
			}
			if(x > 0) {
				if(k * x - b > 0) {
					System.out.println("Case #"+ count++ + ": White win");
				} else {
					System.out.println("Case #" + count++ +": Unknow");
				}
			}
		}
	}
}

Double click to view unformatted code.


Back to problem 13