#include<iostream>
#include<cstdio>
#include<algorithm>
#include<map>
#include<set>
#include<vector>
#include<cstring>
using namespace std;
int arr[20];
int main() {
freopen("in.txt","r",stdin);
int a;
while(scanf("%d",&a) != EOF && a != -1) {
memset(arr,0,sizeof(arr));
arr[0] = a;
int b,len = 0;
for(int i = 1; ; i++) {
cin >> b;
if(b == 0) break;
else {
arr[i] = b;
len = i+1;
}
}
int ans = 0;
for(int i = 0; i < len; i++) {
for(int j = 0; j < len; j++) {
if(arr[i] == 2*arr[j]) ans++;
}
}
cout << ans << endl;
}
return 0;
}
解题报告_18.5.8_POJ_1552
最新推荐文章于 2021-02-27 13:11:16 发布