Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- string slowo;
- int main()
- {
- cout<<"Podaj slowo(z malej litery): ";
- cin>>slowo;
- int d=slowo.size();
- int pomoc=0;
- for(int i=0; i<d/2;i++)
- {
- if(slowo[i]==slowo[d-1-i])
- {
- pomoc++;
- }
- }
- if(d/2==pomoc)
- cout<<"To jest palindrom";
- else
- cout<<"to nie jest palindrom";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement