View Code of Problem 13

#include <iostream>
using namespace std;
int main(){
	int h,a,b,k,cn=1;
	while(cin>>h>>a>>b>>k){
		int flag=0;
		while(k--){
			h-=a;
			if(h<1){
				flag=1;
				break;
			}else{
				h+=b;
			}
		}
		if(flag)
			cout<<"Case #"<<cn<<": White win"<<endl;
		else
			cout<<"Case #"<<cn<<": Unknow"<<endl;
		cn++;
			
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 13