Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static int counter(int A[])
- {
- int sum;
- int e = A.length;
- int count = 0;
- for (int i=0; i<e; i++)
- {
- for (int j=i+1; j<e; j++)
- {
- sum=A[i]+A[j];
- if (-sum==binarySearch(A,sum))
- {
- count++;
- }
- }
- }
- return count;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement