java基础编程60题之13

package com.xijiaopractice;


public class Test13 {
/*
* 题目:一个整数,它加上100后是一个完全平方数,
* 再加上168又是一个完全平方数,请问该 数是多少?
*/
public static void main(String[] args) {

double b=0;
double c=0;
for (int a = 0; a < 100000000; a++) {
b= Math.sqrt(a+100);

c= Math.sqrt(a+100+168);

if(b%1==0&&c%1==0){

System.out.println(a);
}
}
}
}

猜你喜欢

转载自blog.csdn.net/m0_38068868/article/details/81060561
今日推荐