码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-10-03 23:27:48      阅读:234      评论:0      收藏:0      [点我收藏+]

标签:

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);
}
}

}

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

标签:

原文地址:http://www.cnblogs.com/chongchong0207/p/5929625.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!