相反数
from CCF-CSP 2014-03-1
Time limit:1s
Memory limit:256MB
ac代码:
#include<bits/stdc++.h>
using namespace std;
int n,x[1005],a,sum;
int main(){
cin>>n;
while(n--)
cin>>a,++x[abs(a)];
for(int i = 0;i <= 1000;++i)
if(x[i] == 2)
++sum;
cout<<sum;
return 0;
}