Advertisement
Guest User

Eban'

a guest
Apr 29th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <string>
  4. #include <fstream>
  5. using namespace std;
  6. int main()
  7. {
  8.     string str, s;
  9.     int n = 0;
  10.     ifstream Input("My life.txt");
  11.     ofstream Output("My rules.txt");
  12.     while (!Input.eof())
  13.     {
  14.         str = "";
  15.         s = Input.get();
  16.         while (s != "\n" && !Input.eof())
  17.         {
  18.             str = str + s;
  19.             s = Input.get();
  20.         }
  21.         n = str.size();
  22.         for (int i = n - 1; i > -1; i--)
  23.             Output << str[i];
  24.         Output << endl;
  25.     }
  26.     Input.close();
  27.     Output.close();
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement