the question was on a midterm, after submitting my answer i came home and posted that original post.
the prof later posted the question on his site. here is the exact question:
Q1. Write a program that inputs 6 integers, and then checks to see if any combination of exactly three of the first 5 integers adds up to the last integer.
Test Case 1 (TC1): Input 1 –2 4 –1 15 17 Output Yes. – 2 + 4 + 15 = 17
TC2: Input 3 12 11 –4 16 7 Output No.
TC3: Input 0 12 23 –1 11 11 Output Yes. 0 + 12 + – 1 = 11
|