Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool jestPalindromem(char * napis)
- {
- int dlugosc=0;
- while (*napis != '\0')
- {
- dlugosc++;
- *napis = tolower(*napis);
- napis++;
- }
- napis -= dlugosc;
- for (int poczatek = 0, koniec = dlugosc - 1; poczatek < koniec; poczatek++, koniec--)
- {
- while (*(napis + poczatek) == ' ') poczatek++;
- while (*(napis + koniec) == ' ') koniec--;
- if (*(napis + poczatek) != *(napis + koniec)) return false;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement