1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#include <iostream>
using namespace std;
bool timer(int attack, int calm, int worker){ //2, 3, 9 goes in
if (worker - attack <= 0){ //will 9 - 2 = 0 or less?
return false;
}
worker = worker - attack; //9 - 2 = 7
if (worker - calm <= 0){
return true;
}
worker = worker - calm; // 7-3=4
return timer(attack, calm, worker); // 2, 3, 7
}
int main(){
int d1a, d1c, d2a, d2c;
int p, m, g;
cin >> d1a >> d1c >> d2a >> d2c;
cin >> p >> m >> g;
bool x = timer(d1a, d2c, p);
bool xx = timer(d2a, d2c, p);
cout << x << endl;
cout << xx << endl;
|