提交时间:2024-02-19 10:49:57

运行 ID: 41095

#include<iostream> using namespace std; int main() { int n; cin>>n; for(int i=0;i<=n;i++){ int num=i*i; int num1=num; int sum=0; while(num){ sum=sum*10+num%10; num/=10; } if(num1==sum) cout<<num1<<endl; } return 0; }