View Code of Problem 13

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

Double click to view unformatted code.


Back to problem 13