Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// Se da un cuvant format din litere mici sa se verifice un palindrom si sa se afiseze un mesaj corespunzator
- #include<iostream>
- #include<cstring>
- using namespace std;
- char x[256];
- int main()
- {
- cin >> x;;
- int lungime = strlen(x);
- for(int i = 0; i < lungime/2; i++)
- {
- if(x[i] != x[lungime - i - 1])
- {
- cout << "NU";
- return 0;
- }
- }
- cout << "DA";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement