commit b2977aefb8437928908bc76103e8ce025480ef43 parent 9b5ac152bb0509c14d14f15c387edfeef3ba232b Author: mjkloeckner <martinjkloeckner@gmail.com> Date: Thu, 14 Mar 2024 18:01:16 -0300 Added ej02 solution including out stream padding Diffstat:
| A | solutions/ej02.cpp | | | 19 | +++++++++++++++++++ |
1 file changed, 19 insertions(+), 0 deletions(-) diff --git a/solutions/ej02.cpp b/solutions/ej02.cpp @@ -0,0 +1,19 @@ +#include <iostream> +#include <iomanip> + +int main (void) { + int a, b; + + std::cin >> a; + std::cout << "\033[1A\033[0Ka = " << a << std::endl; + + std::cin >> b; + std::cout << "\033[1A\033[0Kb = " << b << std::endl; + + std::cout << "a+b = " << std::setw(2) << a + b << std::endl; + std::cout << "a-b = " << std::setw(2) << a - b << std::endl; + std::cout << "a*b = " << std::setw(2) << a * b << std::endl; + std::cout << "a/b = " << std::setw(2) << a / b << std::endl; + + return 0; +}
