From 7a1e642cbec481959821ce486e69b96ad71e4ca0 Mon Sep 17 00:00:00 2001 From: Angel Dimitriev Date: Tue, 1 Mar 2022 20:47:22 +0200 Subject: Create task1.cpp --- Sem. 02/task1.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Sem. 02/task1.cpp (limited to 'Sem. 02/task1.cpp') diff --git a/Sem. 02/task1.cpp b/Sem. 02/task1.cpp new file mode 100644 index 0000000..862cf07 --- /dev/null +++ b/Sem. 02/task1.cpp @@ -0,0 +1,26 @@ +#include +#include + +using namespace std; + +const int MAX_SIZE = 1024; +int main() +{ + ifstream inputFile("selfPrintingTask.cpp"); + + if (inputFile.fail()) + { + cout << "Error!" << endl; + return -1; + } + + while (!inputFile.eof()) + { + char buff[MAX_SIZE]; + inputFile.getline(buff, MAX_SIZE); + cout << buff << endl; + } + inputFile.close() + + return 0; +} -- cgit v1.3.1-23-gd82d