while s = gets and s != "end\n"
a, op, b = *s.split
a, b = *[a, b].map { |t| t =~ /\./ ? t.to_f : t.to_i }
result = case op
when '+' then a + b
when '-' then a - b
when '*' then a * b
when '/' then a / b
when '%' then a % b
end
puts result.is_a?(Float) ? result.round(3) : result
end
d2hpbGUgcyA9IGdldHMgYW5kIHMgIT0gImVuZFxuIgoJYSwgb3AsIGIgPSAqcy5zcGxpdAoJYSwgYiA9ICpbYSwgYl0ubWFwIHsgfHR8IHQgPX4gL1wuLyA/IHQudG9fZiA6IHQudG9faSB9CgoJcmVzdWx0ID0gY2FzZSBvcAoJd2hlbiAnKycgdGhlbiBhICsgYgoJd2hlbiAnLScgdGhlbiBhIC0gYgoJd2hlbiAnKicgdGhlbiBhICogYgoJd2hlbiAnLycgdGhlbiBhIC8gYgoJd2hlbiAnJScgdGhlbiBhICUgYgoJZW5kCgoJcHV0cyByZXN1bHQuaXNfYT8oRmxvYXQpID8gcmVzdWx0LnJvdW5kKDMpIDogcmVzdWx0CmVuZA==
MiArIDMKNC4xICsgOC4yCjUgLSA2CjUuMjQxIC0gMi4yCjIgKiA1CjMuMSAqIDIKNiAqIC03CjcgLyAzCi03IC8gMwo3IC8gLTMKNy4wIC8gMwoyIC8gMC4wCi0yLjAgLyAwCjAuMCAvIDAuMAo3ICUgMwotNyAlIDMKNyAlIC0zCmVuZAoxMjM0NTY3ODkwICsgMA==
2 + 3
4.1 + 8.2
5 - 6
5.241 - 2.2
2 * 5
3.1 * 2
6 * -7
7 / 3
-7 / 3
7 / -3
7.0 / 3
2 / 0.0
-2.0 / 0
0.0 / 0.0
7 % 3
-7 % 3
7 % -3
end
1234567890 + 0