I have to write a program to read 10 integers into an array. It will then read in one more integer. My program should then compute and output how many distinct pairs of integers in the array add up to the last number that was input. Note I cannot use the same number twice in a sum, unless it has been input two or more times.
How do I go about doing this?