Simple Calculator


Submit solution

Points: 50 (partial)
Time limit: 1.0s
Memory limit: 64M

Authors:
Problem types

題目說明

設計一個簡單的計算機,讓使用者輸入兩個數字和一個運算符號 (+, -, *, /),程式會根據輸入的運算符號計算結果並輸出。

輸入

依序輸入:
第一個數字 (double)
運算符號 (+, -, *, /)
第二個數字 (double)

輸出

兩個數字的運算結果(double)

範例輸入1

10 * 5

範例輸出1

50.0

範例輸入2

15 / 3

範例輸出2

5.0

範例輸入3

12 % 7

範例輸出3

Fail

說明:%沒有在規定的運算子中


Comments

There are no comments at the moment.