Help Me Please :c

I have a little problem, I need to know what the error because it only gives me value and I need capicua values in the range from a to b. Help me: c

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  #include <iostream>

using namespace std;

int main ()
{
    int a,b,s,c = 0,total = 0;
    
    cout << "Por favor ingrese el primer numero: ";
    cin >> a;
    
    cout << "Por favor ingrese el segundo numero: ";
    cin >> b;
    
    while ( a < b ) 
    {
        a += 1;
        s = a;
            while ( s > 0)
            {
                c = c * 10 + s%10;
                s /= 10;
            }
        if ( c == a)
        {
            ++total;
            cout << c ; 
        }  // 
    }
     cout << "\nEl numero de terminos capicua es " << total << endl;
     return 0;
}
Last edited on
Topic archived. No new replies allowed.