#include<iostream>
using namespace std;
int main()
{
int n,b,a;
for(n=0;n<=10000;n++)
{ int k=0;
int m=n;
for(;m>0;m/=10,k++);
//if(k==1)cout<<k<<endl;
a=n*n;
int i=0;
m=n;
for(i=0;i<k;i++){
int p,q;
p=a%10;
q=n%10;
if(p!=q)break;
a/=10;
n/=10;
}
n=m;
if(i==k)cout<<n<<endl;
}
}
标签:std,10,20,cout,int,includeusing From: https://www.cnblogs.com/guozi6/p/17399353.html