用python编的计算器的代码Programmustbeabletoinputatleasttwonumbersandperformoneoperationcorrectlyandoutput:Input:102+=Input:113-=Input:94*=Input:113/=Input:2113%=•Pr...
用python 编的计算器的代码
Program must be able to input at least two numbers and perform one operation correctly and output:
Input:
10
2
+
=
Input:
11
3
-
=
Input:
9
4
*=
Input:
11
3
/
=
Input:
2
11
3
%
=
• Program must be able to handle multiple numbers and multiple operations
Input:
3
3
*4
4
*+
=
Input:
1234
2345
3456
d
+
d
+
d
=
• Program must be able to correctly handle saturation
Input:
2147483647
1
+
=
Input:
-2147483647
1
-
=
20
-
=
Input:
100000
0
100000
-
d
*=
3
• Program includes the less obvious features of srpn. These include but are not limited to:
Input:
1
+
Input:
10
5
-5
+
/
Input:
1 1 + 1 + 1 + d
Input:
# This is a comment
1 2 + # And so is this
d
Input:
3 3 ˆ 3 ˆ 3 ˆ =
Input:
r r r r r r r r r r r r r r r r r r r r r r d r r r d
展开