Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
68078 | 金浩 | 22计算算术表达式 | Python3 | Accepted | 28 MS | 3804 KB | 557 | 2024-03-19 07:54:19 |
n=int(input()) for i in range(n): ss=input() list=["+","-","*","/","%"] for j in range(len(ss)): if ss[j] in list: a=int(ss[:j]) b=int(ss[j+1:]) op=ss[j] if op == "+": x = a + b print(x) elif op == "-": x = a - b print(x) elif op == "*": x = a * b print(x) elif op == "/": while b == 0: b = int(input()) x = int(a / b) print(x) elif op=="%": x=a%b print(x)