Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- bool sprawdz(string s)
- {
- int dl=s.size();
- for(int i=0;i<dl/2;i++)
- if(s[i]!=s[dl-i-1])return false;
- return true;
- }
- }
- main()
- {
- string s;
- cout<<"podaj wyraZ: ";
- cin>>s;
- if (sprawdz(s)) cout<<"\nslowo" <<s<< "jest palindromem"<<endl;
- else cout<<"\nslowo"<<s<<"nie jeste palindorm"<<endl;
- //system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement