View Code of Problem 13

#include<stdio.h>
int main()
{
	int h, a, b, k, pos = 0;
	double v, t;
	int flag;

	while (scanf("%d", &h) != EOF)
	{
	    scanf("%d %d %d", &a, &b, &k);
	    flag = 0;
	    if (a >= h)///
            flag = 1;
        else
        if ( ( ( k*(a-b) )>b ) &&(a > b) )
                flag = 1;
        if (flag)
        printf("Case #%d: White win\n", (pos+1));
        else
            printf("Case #%d: Unknow\n", (pos+1));
        pos++;
	}
}

Double click to view unformatted code.


Back to problem 13