diff --git a/Chapter_1/io.cpp b/Chapter_1/io.cpp new file mode 100644 index 0000000..50aa74a --- /dev/null +++ b/Chapter_1/io.cpp @@ -0,0 +1,13 @@ +#include + +int readNumber() +{ + int a = 0; + std::cin >> a; + return a; +} + +void writeAnswer(int a) +{ + std::cout << a << std::endl; +} diff --git a/Chapter_1/io.hpp b/Chapter_1/io.hpp new file mode 100644 index 0000000..d078fdc --- /dev/null +++ b/Chapter_1/io.hpp @@ -0,0 +1,7 @@ +#ifndef IO_HPP_ +#define IO_HPP_ + +int readNumber(); +void writeAnswer(int); + +#endif diff --git a/Chapter_1/main.cpp b/Chapter_1/main.cpp new file mode 100644 index 0000000..2c714b7 --- /dev/null +++ b/Chapter_1/main.cpp @@ -0,0 +1,13 @@ +#include "io.hpp" + +int main() +{ + int a = 0, b = 0; + + a = readNumber(); + b = readNumber(); + + writeAnswer(a + b); + + return 0; +}