View Code of Problem 13

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



Double click to view unformatted code.


Back to problem 13