diff --git a/main.cpp b/main.cpp index a495fc94..9512cec4 100644 --- a/main.cpp +++ b/main.cpp @@ -1,14 +1,20 @@ #include #include +#include int main() { std::cout << "THE FIRST EXAMPLE MATH DISPLAY!\n"; - std::cout << "Hi, please enter two whole numbers: "; + std::cout << "Hi, please enter two whole numbers\n"; + std::cout << "(Limited to whole numbers between -2,147,483,648 and 2,147,483,647): "; - int x,y; + int32_t x,y; + + if (!(cin >> x >> y)) { + std::cout << "Error: The number is not within the limit.\n"; + return 1; + } - std::cin >> x >> y; std::cout << "Addition: " << x + y << std::endl; std::cout << "Subtraction: " << x - y << std::endl; std::cout << "Multiplication: " << x * y << std::endl;