#include<stdio.h> int is_gog(int n){ int x = n,sum=0; while(x){ sum=sum * 10 + x % 10; x /= 10; } return sum==n; } int main(){ int n; scanf("%d",&n); for(int i=1;i<=n;i++){ if(!is_gog(i))continue; printf("%d\n",i); } return 0; }
标签:10,一个,sum,int,数内,main,回文 From: https://www.cnblogs.com/qingjiawen/p/16842514.html