本题为填空题,只需要算出结果后,在代码中使用输出语句将所填结果输出即可。
小明想找到两个正整数 XX 和 YY,满足
请你求出在所有可能的解中,X + YX+Y 的最小值是多少?
1 #include <iostream> 2 #include <cmath> 3 using namespace std; 4 int main() 5 { 6 int x = 2019,y; 7 while(x++) { 8 int x2 = x*x; 9 int y2 = x2 + (x2 - 2019*2019); 10 int y = sqrt(y2); 11 if(y * y == y2) { 12 cout<<x+y<<endl; 13 break; 14 } 15 } 16 return 0; 17 }
2021-05-16
原文:https://www.cnblogs.com/2015-16/p/14773684.html