dsad

sdasd
mail@pastecode.io avatar
unknown
abc
2 years ago
360 B
1
Indexable
Never
#include <iostream>

using namespace std;

int palindrom(int n,int o) // o va fi zero in int main();
{
    if(n==0)
        return o;
    else
        return palindrom(n/10, o*10+n%10);
}

int main()
{
    int a, b, r=0;
    cin>>a>>b;
    if (a,b) swap (a, b);
    for (int i=a; i<=b; ++i)
     if (i==palindrom(i, 0)) ++r;
     cout<<r;
}