Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstring>
- using namespace std;
- int main()
- {
- int i=0;
- int L=0;
- string napis;
- cout<<"podaj napis"<<endl;
- getline(cin,napis);
- int n=napis.length()-1;
- while(i<n)
- {
- if(napis[I]!=napis[n]) L=1;
- i++;
- n--;
- }
- if(L=1) cout<<"Napis nie jest palindromem";
- else cout<<"Napis jest palindromem";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement