大佬求解
我10分
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,a[1010],ans=0;
cin>>n;
for (int i = 1; i <= n - 1; i++)
{
cin>>a[i];
for (int j = i + 1; j <= n; j++)
{
int m = a[i] + a[j];
int s = d(m);
if (s * s == m)
f++;
}
}
cout<<f;
return 0;
}