diff options
Create task1.cpp
1 files changed, 26 insertions, 0 deletions
| -rw-r--r-- | Sem. 02/task1.cpp | 26 |
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 <iostream> +#include <fstream> + +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; +} |
