Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <Windows.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     setlocale(LC_ALL, "ru");
  9.     SetConsoleCP(1251);
  10.     SetConsoleOutputCP(1251);
  11.     string temp, str;
  12.     char sStr[100] = "string", *word;
  13.     cin.getline(sStr, 100);
  14.     cout << endl;
  15.     cout << sStr << endl;
  16.     word = strtok(sStr, " ");
  17.     while (word != 0)
  18.     {
  19.         temp = word;
  20.         str = word;
  21.         reverse(str.begin(), str.end());
  22.         if (str != temp)
  23.             printf("%s ", str.c_str());
  24.         word = strtok(0, " ");
  25.     }
  26.     getchar();
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement