Official

A - Buy a Pen Editorial by en_translator


For beginners

If \(C\) is Red, then the answer is \(\min(G,B)\); if Green, the answer is \(\min(B,R)\); if Blue, the answer is \(\min(R,G)\).

Such a conditional branch can be implemented with an if statement.

R, G, B = map(int, input().split())
C = input()
if C == "Red":
    print(min(G, B))
if C == "Green":
    print(min(B, R))
if C == "Blue":
    print(min(R, G))

posted:
last update: