Total Selection -- Problem A (5 points)
12 44 22 24 -1 this
You must find those lines where the numbers add up to more than 100 and write out the word on each such line. Input will be from a file PROBLEM1.DAT. There will be no more than 60 characters per line. The five numbers and the world will all be separated by one or more blank characters. Each number will lie between -1000 and +1000. The "word", in this example, will always be a string of lowercase letters with no imbedded or trailing blanks. The file will be terminated by a line consisting of five zeros; 0 0 0 0 0. Output, which must be written to standard output, will be one line for each of the lines of input for which the five numbers add to 101 or more. Each output line must contain a single word, which must be printed starting in the first column.
Example Input12 44 22 24 -1 this 1 2 3 4 5 nothing 101 202 303 404 505 is -101 -202 -303 -404 -505 isn't 0 0 0 0 101 magic 0 0 0 0 0
Example Outputthis is magic |