[text] clkdsfsladfj

Viewer

copydownloadembedprintName: clkdsfsladfj
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4. int main()
  5. {
  6.  
  7.         ofstream fout;
  8.  
  9.         string line;
  10.         fout.open("sample.txt");
  11.  
  12.         while (fout) {
  13.                 getline(cin, line);
  14.                 if (line == "-1")
  15.                         break;
  16.                 fout << line << endl;
  17.         }
  18.         fout.close();
  19.         ifstream fin;
  20.         fin.open("sample.txt");
  21.         while (fin) {
  22.                 getline(fin, line);
  23.                 cout << line << endl;
  24.         }
  25.         fin.close();
  26.  
  27.         return 0;
  28. }
  29.  
  30.        
  31. }

Editor

You can edit this paste and save as new:


File Description
  • clkdsfsladfj
  • Paste Code
  • 10 Aug-2022
  • 408 Bytes
You can Share it: