NOJ/97/main.c

19 lines
322 B
C
Raw Normal View History

2020-08-31 16:46:43 +00:00
#include <stdio.h>
int main(void){
int list[32] = {0}, n, idx = 0;
while(scanf("%d",&n) == 1 && ~n){
if(n) list[idx++] = n;
else{
int count = 0;
for(int i = 0; i < idx; i++){
for(int j = 0; j < idx; j++)
if(list[j] == 2*list[i]) count++;
}
printf("%d\n",count);
idx = 0;
}
}
return 0;
}