Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- bool czy_palindrom(string s) {
- string pomoc=s;
- int zwrot=1;
- for(int i=0;i<s.size()/2+1;i++)
- swap(pomoc[i],pomoc[s.size()-1-i]);
- for(int i=0;i<s.size()/2+1;i++)
- if(pomoc[i]!=s[i])
- zwrot=0;
- return zwrot;
- }
- int main()
- {
- cout<<czy_palindrom("aabbaa");
- }
- // zdefiniuj funkcję i sprawdź jej działanie
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement