aabb问题(输出所有的形如aabb的四位完全平方数)

public static void main(String[] args) {

for(int x=1; ;x++){
int n=x*x;
if(n<1000) continue;
if(n>9999) break;
int h1=n/100;
int lo=n%100;
if(h1%10==h1/10 && lo/10==lo%10){
System.out.println(n);
}
}

}

posted @ 2016-10-03 21:14  &虫虫  阅读(3437)  评论(0编辑  收藏  举报