Min Of Three (T Times)
Python
Easy
5 views
Problem Description
For each testcase you get three integers. Output the minimum among them.
Input Format
First integer t. Then t lines: a b c.
Output Format
t lines minimums.
Sample Test Case
Input:
3
5 9 1
-2 -2 0
10 10 10
Official Solution
import sys
p=sys.stdin.read().strip().split()
if not p:
sys.exit(0)
it=iter(p)
t=int(next(it))
out=[]
for _ in range(t):
try:
a=int(next(it)); b=int(next(it)); c=int(next(it))
m=a if a<b else b
m=m if m<c else c
out.append(str(m))
except Exception:
out.append('0')
sys.stdout.write('\
'.join(out))
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!