Files
python/C++课程/习题训练/7744问题_1.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

19 lines
416 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include<bits/stdc++.h>
using namespace std;
int main()
{
int a, b, n;
double m;
for(a = 1; a <= 9; a++)
{
for(b = 0; b <= 9; b++)
{
n = 1100*a + 11*b;
m = sqrt(n);
if(floor(m+0.5) == m) printf("(1):%d\n", n);//判断两个浮点数是否相等floor函数的作用是返回m的整数部分加上0.5是为了减少误差影响。
}
}
return 0;
}