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

完全平方数

时间:2017-11-07 23:03:00      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:code   多少   for   github   com   blank   http   nbsp   out   

题目:一个整数,它加上100后是一个完全平方数,加上168又是一个完全平方数,请问该数是多少? 

for(int i=0;i<=100000;i++){
   if(Math.sqrt(i+100)%1==0&&Math.sqrt(i+268)%1==0){
       System.out.println(i);
   }
}

源码

完全平方数

标签:code   多少   for   github   com   blank   http   nbsp   out   

原文地址:http://www.cnblogs.com/aeolian/p/7801536.html

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