循环结构设计(用简单的程序,我刚刚入门,鞠躬god)

输入a,b, 寻找并输出a~b之间的回文数m,输出时控制5个数一行。‪‬‪‬‪‬‪‬‪‬‬‭‬‪‬‪‬‪‬‪‬‪‬‪‬‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‬‫‬‬‪‬‪‬‪‬‪‬‪‬‬‭‬‪‬‪‬‪‬‪‬‪‬‪‬‬‪‬‬
回文数的判断方法:10取余的方法,从最低位开始,依次取出该数的各位数字。按反序重新构成新的数,比较与原数是否相等,若相等,则原数为回文。‪‬‪‬‪‬‪‬‪‬‬‭‬‪‬‪‬‪‬‪‬‪‬‪‬‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‬‫‬‬‪‬‪‬‪‬‪‬‪‬‬‭‬‪‬‪‬‪‬‪‬‪‬‪‬‬‪‬‬
输出格式要求:
cout<<setw(8)<<n;  


bool huiwen(int d)
{
    int a,b,c;
    c = d;
    b = 0;
    do
    {
        a = c%10;
        b = b*10 + a;
        c = c/10;
    }while(c>0);

    if(d == b)
    {
        return true;
    }
    else
    {
        return false;
    }
}

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>

using namespace std;
int main()
{
    int a,b;
    int n = 1;
    scanf("%d,%d",&a,&b);

    for(int i = a;i<=b;i++)
    {
        if(huiwen(i) == true)
        {
            if(n>5)
            {
              cout<<endl;
              n=1;
            }
            cout<<setw(8)<<i;
            n++;
        }
    }

这个方法有局限性。要是输入一个INT_MAX你怎么办