#include <iostream>
using namespace std;
void decideBuyIphoneVer1(bool cond1, bool cond2, bool cond3) {
if (cond1)
if (cond2)
if (cond3)
printf("You will buy IPHONE X\n");
else
printf("You will not buy IPHONE X\n");
else
printf("You will not buy IPHONE X\n");
else
printf("You will not buy IPHONE X\n");
}
void decideBuyIphoneVer2(bool cond1, bool cond2, bool cond3) {
if (cond1 && cond2 && cond3)
printf("You will buy IPHONE X\n");
else
printf("You will not buy IPHONE X\n");
}
int main() {
bool haveMoney = false;
bool wantToBuy = false;
bool needToBuy = false;
//Use version1 or version2 for decision?
decideBuyIphoneVer1(haveMoney, wantToBuy, needToBuy);
decideBuyIphoneVer2(haveMoney, wantToBuy, needToBuy);
return 0;
}