100

2014 -3-1

#include<iostream>
using namespace std;
const int N=500;

int main ()
{
	int n,cnt=0,a[N];
	cin >>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	for(int i=1;i<=n;i++)
		for(int j=i;j<=n;j++)
		if(a[i]+a[j]==0)
		cnt++;
	cout<<cnt;
}

 

相关文章:

  • 2021-10-14
  • 2022-02-09
  • 2021-08-12
  • 2021-08-12
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
猜你喜欢
  • 2022-01-19
  • 2021-05-13
  • 2022-12-23
  • 2021-11-17
  • 2021-10-21
  • 2021-07-24
  • 2022-12-23
相关资源
相似解决方案