|
Time |
Memory |
| Case 1 |
1 sec |
32 MB |
| Case 2 |
1 sec |
32 MB |
| Case 3 |
1 sec |
32 MB |
| Case 4 |
1 sec |
32 MB |
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.
Tags