Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by Daniel ( 15 years ago )
#include <iostream>
using namespace std;
int invert(int);
int invert(int z)
{
   int a,b,c,d,e,f;
if (z>=10000)
{
             a=(z-(z000))/10000;
             b=((z000)-((z000)00))/1000;
             c=(((z000)00)-(((z000)00)0))/100;
             d=((((z000)00)0)-((((z000)00)0)))/10;
             e=((((z000)00)0))/1;
             f=e*10000+d*1000+c*100+b*10+a;
             return f;
}

if (z>=1000 && z<10000)
{
             a=(z-z00)/1000;
             b=((z00)-(z00)0)/100;
             c=(((z00)0)-((z00)0))/10;
             d=((z00)0);
             f=d*1000+c*100+b*10+a;
             return f;
}

if (z>=100 && z<1000)
{
             a=(z-z0)/100;
             b=((z0)-((z0)))/10;
             c=(((z0))-(((z0))%1))/1;
             f=c*100+b*10+a;
             return f;
}

if (z>=10 && z<100)
{
             a=(z-z)/10;
             b=((z)-((z)%1))/1;
             f=b*10+a;
             return f;
}

if (z>=1 && z<10)
return z;       
}

int main()
{   
    int num,i;
    int vector[10]; 
    for(i=0; i<=9; i++)
    {
               cout<<"\nIngrese un numero\n";
               cin>>num;
               vector[i]=num;
    }
    for(i=0; i<=9; i++)
    {
             if(vector[i]==invert(vector[i]))
             cout<<vector[i]<<" en la posicion"<<i<<"\n";
    }
 system&#40;"pause"&#41;; 
}

 

Revise this Paste

Your Name: Code Language: