Minimum of Three
Python
Easy
4 views
Problem Description
Read three integers a b c. Output the minimum using operators and comparisons.
Input Format
One line: a b c.
Output Format
One integer minValue.
Official Solution
import sys
p=sys.stdin.read().strip().split()
if len(p)<3: sys.exit(0)
a=int(p[0]); b=int(p[1]); c=int(p[2])
mn=a
if b<mn: mn=b
if c<mn: mn=c
sys.stdout.write(str(mn))
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!