Advertisement
Kasamundo

Palindorm

Mar 4th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6. bool zm=true;
  7. string wyraz;
  8. cin>>wyraz;
  9. int dl=wyraz.size();
  10. for(int i=0;i<dl/2;i++){
  11. if(wyraz[i]!=wyraz[dl-1-i]){
  12.  
  13. zm=false;
  14. break;
  15. }
  16. }
  17. if(zm==true) cout<<"Palindrom";
  18. else cout<<"Nie jest palindromem";
  19.  
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement