n = int(input())
max = n
min = n
while (n != 0):
if n != 0:
if n > max:
elif n < min:
print(min,max)
5
7
2
3
0
2 7
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Python:
n = int(input())
max = n
min = n
while (n != 0):
n = int(input())
if n != 0:
if n > max:
max = n
elif n < min:
min = n
print(min,max)
Input/Output:
5
7
2
3
0
2 7