Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3. using namespace std;
  4. int main()
  5. {
  6. int i=0;
  7. int L=0;
  8. string napis;
  9. cout<<"podaj napis"<<endl;
  10. getline(cin,napis);
  11. int n=napis.length()-1;
  12. while(i<n)
  13. {
  14. if(napis[I]!=napis[n]) L=1;
  15. i++;
  16. n--;
  17. }
  18. if(L=1) cout<<"Napis nie jest palindromem";
  19. else cout<<"Napis jest palindromem";
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement