Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<climits>
- using namespace std;
- int main()
- {
- int n, apare=0, x, ogl, maxim=INT_MIN, aux, contor=0;
- for(cin>>x; x!=0; cin>>x)
- {
- aux=x;
- ogl=0;
- while(aux>0)
- {
- ogl=ogl*10+x%10;
- x=x/10;
- }
- if(x==ogl)
- {
- contor++;
- if(x>maxim)
- {
- maxim=x;
- apare=1;
- }
- else
- {
- if(x==maxim)
- {
- apare++;
- }
- }
- }
- }
- if(contor==0)
- {
- cout<<"NU EXISTA";
- }
- else
- {
- cout<<maxim<<" "<<apare;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement