#include <iostream>
int main()
{
// Print welcome messages to terminal
std::cout << "You are a secret agent breaking into a secure server room...";
std::cout << std::endl;
std::cout << "You need to enter the correct codes to continue..." << std::endl;
// Declare 3 number code
const int CodeA = 4;
const int CodeB = 3;
const int CodeC = 2;
const int CodeSum = CodeA + CodeB + CodeC;
const int CodeProduct = CodeA * CodeB * CodeC;
// Print CodeSum and CodeProduct to terminal
std::cout << std::endl;
std::cout << "+ There are 3 numbers in the code" << std::endl;
std::cout << "+ The codes add up to: " << CodeSum << std::endl;
std::cout << "+ The codes multiply to give: " << CodeProduct << std::endl;
// Get User Guess
int GuessA, GuessB, GuessC;
std::cin >> GuessA;
std::cin >> GuessB;
std::cin >> GuessC;
int GuessSum = GuessA + GuessB + GuessC;
int GuessProduct = GuessA * GuessB * GuessC;
// Determine win or loss condition
if (GuessSum == CodeSum && GuessProduct == CodeProduct)
{
std::cout << "You found the correct code and have successfully entered the server room.";
}
else
{
std::cout << "I'm sorry, that code is not correct. Authorities have been notified of your presence and are on their way!";
}
return 0;
}