#include<bits/stdc++.h> using namespace std; int main(){ int h,a,b,k; int num = 1; while(scanf("%d%d%d%d",&h,&a,&b,&k)!=EOF){ for(int i = 0;i<k;i++){ h = h - a; if( h < 1 ) { printf("Case #%d: White win",num); break; } h+=b; } if(h > 1)printf("Case #%d: Unknow",num); cout<<endl; num++; } return 0; } |
Double click to view unformatted code.