Kicrosoft @ 2024-12-06 17:57:40
#include<bits/stdc++.h>
#include<bits/stdc++.h>
using namespace std;
int a[10005],b[1000005];
int main(){
int n,sum,cnt=0,k=0;
cin >> n;
for(int i=0;i<n;i++){
cin >> a[i];
}
for(int i=0;i<n-1;i++){
for(int j=i+1;j<n;j++){
b[k]=a[i]+a[j];
k++;
}
}
for(int i=0;i<k;i++){
if(i*i==b[i]){
cnt++;
continue;
}
}
cout << cnt;
return 0;
}
by WuJiaNuo19 @ 2024-12-06 18:04:44
@Kicrosoft
#include<bits/stdc++.h>
using namespace std;
int a[10005],b[1000005];
int main(){
int n,sum,cnt=0,k=0;
cin >> n;
for(int i=0;i<n;i++){
cin >> a[i];
}
for(int i=0;i<n-1;i++){
for(int j=i+1;j<n;j++){
b[k]=a[i]+a[j];
k++;
}
}
for(int i=0;i<k;i++){
int t=sqrt(b[i]);
if(t*t==b[i]){
cnt++;
continue;
}
}
cout << cnt;
return 0;
}
by WuJiaNuo19 @ 2024-12-06 18:05:39
@Kicrosoft 实测,已过 你回去看一下题目问的什么
by Kicrosoft @ 2024-12-06 18:07:03
@WuJiaNuo19 谢谢啊