Advertisement
DasShelmer

9.1.19

Dec 5th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <fstream>
  4. using namespace std;
  5.  
  6. int main() {
  7.     ifstream in ("f1.txt");
  8.     ofstream out("f2.txt");
  9.  
  10.     while (in) {
  11.         string line;
  12.         getline(in, line);
  13.         if (line.length() % 2 == 0 && line != "")
  14.             out << line << endl;
  15.     }
  16.     in.close();
  17.     out.close();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement