TripleX - Terminal 2

Hi everyone,

#include <iostream>

int main()
{
    //print welcome text
    std::cout << ":: Welcome to the //SERVER"; 
    std::cout << std::endl;
    std::cout << ":: You need to enter the correct //CODE to continue";
    std::cout << std::endl; 

    const int CodeA = 4;
    const int CodeB = 8;
    const int CodeC = 16;

    const int CodeSum = CodeA + CodeB + CodeC;
    const int CodeProduct = CodeA * CodeB * CodeC;

    //print sum + product to terminal
    std::cout << std::endl; 
    std::cout << ":: There are (3) numbers in the //CODE" << std::endl;
    std::cout << ":: The //CODE (+) equals=" << CodeSum << std::endl;
    std::cout << ":: The (x) of the //CODE equals=" << CodeProduct << std::endl;

    int GuessA, GuessB, GuessC;

    std::cin >> GuessA;
    std::cin >> GuessB;
    std::cin >> GuessC;

    int GuessSum = GuessA + GuessB + GuessC;
    int GuessProduct = GuessA * GuessB * GuessC;

    if (GuessSum == CodeSum && GuessProduct == CodeProduct)
    {
        std::cout << ":: Winner winner horsechop dinner ::" << std::endl;
        std::cout << ":: Accessing launch codes... 98.7% ::" << std::endl;
    }
    else
    {
        std::cout << ":: ***ERROR*** ::" << std::endl;
        std::cout << ":: (LOCAL) + (FEDERAL) authorities are being notified. ::" << std::endl;
        std::cout << ":: SUCCESS: //CURRENT.LOCATION shared with (LOCAL) + (FEDERAL) authorities. Please Wait. ::" << std::endl;

    }
    

    return 0;
}
1 Like

Nice!

1 Like

Privacy & Terms