题目详情:
解题思路:
本题只需要通过循环进行比较,即可得出答案
代码实现:
public class d1217 {
public static void main(String[] args) {
double start = 2019;
for (int i = 2020;; i++) {
double xx = i*i;
double yy = xx-start*start+xx;
double y = Math.sqrt(yy);
if(y == Math.ceil(y)){
System.out.println((int)(i+y));
break;
}
}
}
}
答案:
7020