#include<iostream>
using namespace std;
int main(){
int i,n[100],ans=0;//i:心算的数字的数目,3<i<100.n[100]:测试题中的正整数.ans:答案
cin>>i;
for(int a=1;a<=i;a++){
cin>>n[a];
}
for(int locate=1;locate<=i-1;locate++){//locate:当前心算数的位置
for(int locateplus=locate+1;locateplus<=i;locateplus++){//locateplus:与当前心算数相加的数的位置
int result=n[locate]+n[locateplus];
//cout<<n[locate]<<" + "<<n[locateplus]<<" = "<<result<<endl; //DEBUG
for(int check=1;check<=i;check++){//check:检查结果是否与测试题中的数相等
if(result==n[check]){
//cout<<"Result is same as the No."<<check<<endl; //DEBUG
ans++;
}
}
}
}
cout<<ans<<endl;
return 0;
第二个测试点输出为26,本地检查了输出的加法结果也和原数据对的上……