Skip to content

Commit

Permalink
Completed 24. Using if and else in C++
Browse files Browse the repository at this point in the history
  • Loading branch information
RunninglVlan committed Sep 8, 2020
1 parent fb95203 commit bd2a58b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 02-TripleX/TripleX.cpp
Expand Up @@ -20,6 +20,8 @@ int main()
std::cin >> GuessA >> GuessB >> GuessC;
const int GuessSum = GuessA + GuessB + GuessC;
const int GuessProduct = GuessA * GuessB * GuessC;
const bool bCorrect = GuessSum == CodeSum && GuessProduct == CodeProduct;
std::cout << fmt::format("You guessed {}", bCorrect ? "right" : "wrong");

return 0;
}

0 comments on commit bd2a58b

Please sign in to comment.