// 回文数.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include<iostream>
using namespace std;
bool isHuiWen(int num){
int temp;
int sum = 0;
temp = num;
while (num)
{
sum = sum * 10 + num % 10;
num /= 10;
}
if (temp == sum)
return true;
else
return false;
}
int _tmain(int argc, _TCHAR* argv[])
{
system("chcp 936");
cout << "input 2 numbers:";
int a, b;
cin >> a >> b;
int count = 0;
for (int i = a; i <= b; i++){
if (isHuiWen(i))
count++;
}
cout << "there are " << count << " numbers between" << a << " and " << b << endl;
system("pause");
return 0;
}