View Code of Problem 13

#include <stdio.h>
int main (void)
{
	int h,a,b,k,j=1;
	int n;
	while(scanf("%d %d %d %d",&h,&a,&b,&k) != EOF)
	{
		if(h-a<=0)
			printf("Case #%d: White win\n",j++);
		if(h-a>0&&a<b)
			printf("Case #%d: Unknow\n",j++);
		if(h-a>0&&a>b)
		{
                  n = h-(a-b)*k+b;
			if(n<h)
				printf("Case #%d: White win\n",j++);
			else
				printf("Case #%d: Unknow\n",j++);
			}	
		}
		
	
	return 0;
}

Double click to view unformatted code.


Back to problem 13