Title Description
A car traveling at a constant speed, the driver can see at 10 o'clock in the morning reading on the odometer is a symmetrical number (ie the number read from left to right and right to left reading are exactly the same), to 95,859. Two hours later there was a new symmetric number on the odometer. Q. What is the speed of the car? The new number is the number of symmetry?
## Sample Output
95959
Tip
meaning of the questions, ask disposed symmetrically number i, which is the initial value 95589, its value in ascending order, each i is an exploded value after comparing the number of its symmetrical position, if each of the symmetrical positions number are equal, it is judged that the number i is also desired symmetry of.
#include<bits/stdc++.h>
using namespace std;
int main(){
int a=95589;
int b,m,x,z,n;
while(a++)
{
z=0;
n=a;
b=ceil(log10(a));
m=pow(10,b-1);
for(int i=0;i<b;i++)
{
x=a/m*pow(10,i);
a=a%m;
m=m/10;
z=z+x;
}
a=n;
if(a==z)
{
cout<<z;
break;
}
}
return 0;
}