0
lent me a hint for this problem please? (Java)
Write a Java program to find the two elements from a given array of positive and negative numbers such that their sum is closest to zero.
3 Antworten
0
~ swim ~ hmm,i only know using double forloop to find the sum ,but dont know how to add 1,-1
0
> "how to add 1,-1"
arr[1,-1,2,-3]
sum = arr[0] + arr[1] ; //1 + (-1)