Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- char str[] = "kek lol orbidol dadasad";
- int i = 0,length;
- bool b;
- do
- {
- length = 0;
- do
- {
- i++;
- length++;
- }
- while ((str[i - 1] != ' ') && (str[i - 1] != '\0'));
- b = true;
- for (int j = 0; j<length / 2; j++)
- if (str[i - length ] != str[i - 2])
- b= false;
- if (b)
- for (int j = i - length; j<i - 1; j++)
- cout << str[j];
- cout << endl;
- }
- while (i < strlen(str));
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment