#include #include using namespace std; const string SRC_FILE_PATH = "./29.in"; const string DST_FILE_PATH = "./29.out"; int main() { string line; fstream src, dst; src.open(SRC_FILE_PATH, ios_base::in); dst.open(DST_FILE_PATH, ios_base::out); dst.close(); dst.open(DST_FILE_PATH, ios_base::app); if (!src.is_open()) exit(1); while (getline(src, line)) { dst << line; if (src.peek() != EOF) { dst << endl; } } src.close(); dst.close(); return 0; }