Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- unsigned int x, prod = 1;
- cin >> x;
- while(x > 0)
- {
- if(x%2 == 1)
- {
- prod = prod * x;
- }
- cin >> x;
- }
- cout << prod << endl;
- unsigned int ogl = 0, aux = prod;
- while(aux > 0)
- {
- ogl = ogl*10 + aux%10;
- aux = aux / 10;
- }
- if(ogl == prod)
- cout << "Produsul este palindrom";
- else
- cout << "Produsul nu este palindrom";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement