forked from natto1784/ooplab
32 lines
521 B
C++
32 lines
521 B
C++
#include <fstream>
|
|
#include <iostream>
|
|
|
|
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;
|
|
}
|