4个一位数的数字,并尝试获得所有可能的组合
4511
比如4+5+1 x 1
获取第一个、第二个、第三个和第四个数字的代码
numbers = input("Input 4 numbers separated with , : ")
numlist = numbers.split(",")
print (numlist)
No1 = int(numlist.pop(0))
No2 = int(numlist[0])
No3 = int(numlist[1])
No4 = int(numlist[2])
Tags:
使用递归方法:
您的I/O错误(前两行),我不知道这是否是您已经尝试过的。你知道吗
详尽的搜索:
输出示例:
或者
注意:我喜欢上面评论中提到的递归表达式生成器,但我不认为它是直接递归的。你知道吗
相关问题 更多 >
编程相关推荐