number = float(input())
type_number = input()
type_exit = input()
if type_number == "m" and type_exit == "cm":
number_exit = number * 100
elif type_number == "m" and type_exit == "mm":
number_exit = number * 1000
elif type_number == "cm" and type_exit == "m":
number_exit = number / 100
elif type_number == "cm" and type_exit == "mm":
number_exit = number * 10
elif type_number == "mm" and type_exit == "m":
number_exit = number / 1000
elif type_number == "mm" and type_exit == "cm":
number_exit = number/10
print(f"{number_exit:.3f}")
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.