题解 P6467 【[COCI2008-2009#6] BUKA】

日常用 Python 水高精


思路

输入 (2) 个数和 (1) 个字符,如果字符 (s)+,则输出 (a + b),否则输出 (a imes b)


代码实现

  1. 读入 (2) 个数 (a,b)(1) 个字符 (s)
a = int(input())
zf = input()
b = int(input())
  1. 判断是 + 还是 *。如果是 +,则输出 (a + b),否则输出 (a imes b)
if zf == '+
' :
    print(a + b)
else :
    print(a * b)

Code

a = int(input())
zf = input()
b = int(input())
if zf == '+
' :
    print(a + b)
else :
    print(a * b)
原文地址:https://www.cnblogs.com/tearing/p/12817977.html