Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <algorithm>
- using namespace std;
- int main() {
- ifstream file;
- file.open("..\\tess.txt");
- //error checking
- if (!file.is_open()) {
- cout << "ERROR\n\n";
- return 1;
- }
- string str; //читаю строку
- int rez = 0; //результат
- while (getline(file, str)) {
- reverse(str.begin(), str.end());
- cout << str <<endl;
- }
- file.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment