forked from natto1784/ooplab
26
lab10/28.cpp
Normal file
26
lab10/28.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
const string FILE_PATH = "./28.in";
|
||||
|
||||
int main() {
|
||||
string line;
|
||||
|
||||
fstream file;
|
||||
file.open(FILE_PATH, ios_base::in);
|
||||
|
||||
if (!file.is_open())
|
||||
exit(1);
|
||||
|
||||
while (getline(file, line)) {
|
||||
cout << line;
|
||||
if (file.peek() != EOF) {
|
||||
cout << endl;
|
||||
}
|
||||
}
|
||||
|
||||
file.close();
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user