#include <iostream>
int main()
{
// defining variables
const int CodeA = 4;
const int CodeB = 3;
const int CodeC = 2;
const int CodeSum = CodeA + CodeB + CodeC;
const int CodeProduct = CodeA * CodeB * CodeC;
// printing the story
std::cout << "*You have entered the vault*";
std::cout << std::endl;
std::cout << "That was a close one.";
std::cout << std::endl;
std::cout << "Now all I need is to pick the safe!" << std::endl;
// print defined variables
std::cout << std::endl;
std::cout << "- There are 3 numbers in the code to the safe" << std::endl;
std::cout << "- The codes add up to " << CodeSum << std::endl;
std::cout << "- The codes multiply to get " << CodeProduct << std::endl;
int GuessA, GuessB, GuessC;
std::cin >> GuessA;
std::cin >> GuessB;
std::cin >> GuessC;
const int GuessSum = GuessA + GuessB + GuessC;
const int GuessProduct = GuessA * GuessB * GuessC;
// logic system
if (GuessSum == CodeSum && GuessProduct == CodeProduct)
{
std::cout << "You cracked the safe! Everything is yours now.";
}
else
{
std::cout << "Hmm, the lock didn't budge. Must be the wrong combination.";
}
return 0;
}