forked from natto1784/ooplab
27 lines
432 B
C++
27 lines
432 B
C++
#include <fstream>
|
|
#include <iostream>
|
|
|
|
using namespace std;
|
|
const string FILE_PATH = "./27.out";
|
|
|
|
int main() {
|
|
string line;
|
|
|
|
cout << "Running program till the string \"EOH\" is received via stdin"
|
|
<< endl;
|
|
|
|
ofstream file(FILE_PATH);
|
|
|
|
file.close();
|
|
file.open(FILE_PATH, ios_base::app);
|
|
|
|
while (getline(cin, line)) {
|
|
if (line == "EOH")
|
|
break;
|
|
file << line << endl;
|
|
}
|
|
|
|
file.close();
|
|
return 0;
|
|
}
|