From e61e04619d0c9dd4d079532eff3483e234fc8acd Mon Sep 17 00:00:00 2001 From: hybrid Date: Mon, 24 Aug 2026 00:48:14 +0300 Subject: add: lesson{5,6}, CMakeLists.txt --- src/chapter1/lesson5/multiple_cin.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/chapter1/lesson5/multiple_cin.cpp (limited to 'src/chapter1/lesson5/multiple_cin.cpp') diff --git a/src/chapter1/lesson5/multiple_cin.cpp b/src/chapter1/lesson5/multiple_cin.cpp new file mode 100644 index 0000000..991e397 --- /dev/null +++ b/src/chapter1/lesson5/multiple_cin.cpp @@ -0,0 +1,14 @@ +#include // for std::cout and std::cin + +int main() +{ + std::cout << "Enter two numbers separated by a space: "; + + int x{}; // define variable x to hold user input (and value-initialize it) + int y{}; // define variable y to hold user input (and value-initialize it) + std::cin >> x >> y; // get two numbers and store in variable x and y respectively + + std::cout << "You entered " << x << " and " << y << '\n'; + + return 0; +} -- cgit v1.3.1