#include<iostream>
usingnamespace std;
int TestaSeCapicua(int num);
int main()
{
int num;
cout << "enter number with 6 digits: ";
cin >> num;
TestaSeCapicua(num);
if (TestaSeCapicua(num)==3) cout << "the number is palindrome" << endl;
else cout << "the number its no palindrome" << endl;
system("pause");
return 0;
}
int TestaSeCapicua(int num)
{
int aux[6] = {0};
int certo=0;
for (int n=0; n<=5; ++n)
{
aux[n] = num % 10;
num /= 10;
}
for (int i=0; i<=3; ++i)
{
for (int j=6; j!=3; --j)
{
if (aux[i] == aux[j])
{
certo = certo + 1;
return certo;
}
else
{
return 0;
break;
}
}
}
return 0;
}