Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- int main()
- {
- string textt, word, rez;
- ifstream ss("text.txt");
- while (ss >> word)
- {
- bool flag = 1;
- for (int i = 0; i < word.size() / 2; i++)
- {
- if (word.at(i) != word.at(word.size() - i - 1))
- {
- flag = 0;
- break;
- }
- }
- if (flag)
- {
- rez += word;
- rez += " ";
- }
- }
- ofstream sss("text2.txt");
- sss << rez;
- cout << "Program was completed. You can see result in project folder." << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement