| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 12730 | Variable Operation |
|
Description
Given 4 lines of text, you need to parse it and perform data operations to fit the requirement.
You may need this code to read the lines and keep values in the list:
import sys
words = []
for line in sys.stdin.readlines():
words.append(line.strip())You may also need the function round() to limit the digit numbers of float.
An example is shown below.
>>> print(round(5.123456, 1))
5.1Input
4 lines of text with the following syntax:
e1
e2
e3
e4
where e1, ... , e4 represented 4 elements from given text.
Output
A line of text with the following operations:
e1 multiply e2 plus e4 multiply e3
Note that the details of the operations are:
- e1 multiply e2 should be numbered multiplication and round the multiplication to only first decimal
- e4 multiply e3 should be the string multiplication
- e1, e2, e3 are considered as numbers, while e4 is a word.