弟弟的作业-题解(Python代码) n=0whileTrue:try:x=input(str())foriinx:if(i=="+"ori=="-"):d=ix=x.replace("+","")x=x.replace("-","")x=x.replace("=","")x=x.split("")a=int(x[0])b=int(x[1 题解列表 2020年02月09日 0 点赞 0 评论 1577 浏览 评分:0.0
1073: 弟弟的作业(python 代码) 摘要:解题思路:注意事项:参考代码:s =0 while True: try: m = input() if '?' not in m: if '+' in …… 题解列表 2022年01月16日 0 点赞 0 评论 905 浏览 评分:0.0
弟弟的作业(python代码) 摘要:import sys def jud(x): m = 0 for i in x: if i == '-' or i == & 题解列表 2023年01月23日 0 点赞 0 评论 491 浏览 评分:0.0
弟弟的作业——判断算式是否正确 摘要:解题思路:参考了其他作者的代码,利用‘==’,判断算式是否成立注意事项:参考代码:def check(L): if '?' in L: return 0 el…… 题解列表 2023年03月17日 0 点赞 0 评论 552 浏览 评分:0.0
1073: 弟弟的作业 摘要:```python score = 0 while True: try: user = input().split("=") if user[1] =…… 题解列表 2023年12月20日 1 点赞 0 评论 576 浏览 评分:0.0
弟弟的作业-题解(Python代码)超级简单,易懂!!! **代码如下:**n=0whileTrue:try:x=input()x=x.replace("+","")x=x.replace("-","")x=x.replace("=","")x=x.split("")a=int(x[0])b=int(x[1])c=x[2]ifc=="?":continuei 题解列表 2019年12月11日 0 点赞 1 评论 1906 浏览 评分:6.0
弟弟的作业-题解(Python代码) 解题思路:将整个式子作为字符串读入,然后先判断是否存在问号,若有则直接跳过该轮循环开始下一个式子的读取。若不存在问号,则分两种情况,其一为加法,其二为减法。通过检查字符串中运算符的位置,可以读出两个加数(减数/被减数)的相对位置,并将字符串做相应切片,再转为int整型。 题解列表 2021年02月05日 0 点赞 0 评论 1354 浏览 评分:7.0
弟弟的作业 (Python代码) 摘要:解题思路:这道题其实就是输入字符串,而且输入的字符串是一条算式,既然是一条算式,则必定有等于号'=',所以首先先根据这一性质进行将字符串进行划分为有两个元素的列表,也就是列表中第零个元…… 题解列表 2021年07月22日 0 点赞 0 评论 858 浏览 评分:7.3
正则表达式 快速切片 摘要:解题思路:注意事项:参考代码:import resm=0try: while True: s = input() if len(s) == 0: …… 题解列表 2021年11月08日 0 点赞 0 评论 1163 浏览 评分:7.3
优质题解 弟弟的作业 (Python代码) 摘要:## 解题思路 > 此题用Python解是非常方便的,因为Python对字符串的处理能力特别强。 #### 此题的关键就是以下两个方面: ##### 一、如何多行输入 我是用`try ..…… 题解列表 2020年02月24日 1 点赞 5 评论 2375 浏览 评分:9.1