Thread: [c++] array
View Single Post
Old 11-23-2004, 04:36 PM   #9 (permalink)
mr.montreal
Upright
 
Location: montreal,canada
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
mr.montreal is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73