You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
398 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#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;
}