Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Introduceti un sir de numere pana cand este introdusa valoarea 0 si afisati cate numere din acestea sunt panlindroame
- #include <iostream>
- using namespace std;
- int main()
- {
- int cx,x,ogl,nr,c;
- cout<<"x= "; cin>>x;
- nr= 0;
- while (x)
- {
- cx=x;
- ogl=0;
- while (cx)
- {
- c=cx%10;
- cx=cx/10;
- ogl=ogl*10 +c;
- }
- if (x==ogl)
- nr++;
- cout<<"x= "; cin>>x;
- }
- cout<<"nr= "<<nr<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement