看到一个比较好的判断回文数的方法,摘录了下来 bool pd(int n)//判断是否是回文数 { int temp=n; int m=0; while(temp) { m=m*10+temp%10;//m为n的逆序 temp/=10; } return n==m; }