12938 - Max/Min Integer   

Description

  • Write a program that asks the user to input an arbitrary number of positive integers terminated by the sentinel ‘-1’.
  • Your program output the largest and the smallest integer among them.
  • You do not need to handle input exceptions (e.g., negative numbers, characters, … etc )

Input

  • A list of numbers, belonging to the set N, such that 0 < N ⩽ 2147483647.
  • The last number should be -1.

Output

  • Two integers delimited by a whitespace character, with a trailing '\n' character.
  • The first integer being the maximum integer, the second integer being the minimum integer.

Sample Input  Download

Sample Output  Download

Tags




Discuss