View Code of Problem 13

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

Double click to view unformatted code.


Back to problem 13