Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int i=0,length,k=0;
- bool polindrom;
- char x[80];
- cin.get(x,80);
- do
- {
- length = 0;
- do
- {
- i++;
- length++;
- }
- while ((x[i - 1] != ' ') && (x[i - 1] != '\0'));
- polindrom = true;
- for (int j = 0; j<length / 2; j++)
- if (x[i - length + j] != x[i - j - 2])
- polindrom = false;
- if (polindrom)
- k++;
- }
- while (x[i] != '\0');
- cout <<"kol-vo ="<< k;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment