1119: C语言训练-"水仙花数"问题1(python解) 摘要:解题思路:将三位数拆分存入a,b,c进行计算注意事项:参考代码:n=int(input())a=n%10b=n//10%10c=n//100if(a**3+b**3+c**3==n): prin…… 题解列表 2022年01月28日 0 点赞 0 评论 296 浏览 评分:0.0
编写题解 1671: 小九九 摘要:```python for i in range(1,10): for j in range(1,i+1): if j*i…… 题解列表 2022年01月28日 0 点赞 0 评论 785 浏览 评分:7.3
python-最大乘积 摘要:解题思路:深度优先算法。所给出的两个数只有两个状态,选中和未选中。然后据此写出代码即可注意事项:参考代码:from cmath import inf def dfs(temp,cnt,n…… 题解列表 2022年01月28日 0 点赞 0 评论 349 浏览 评分:9.9
python-简单计算机器实现 摘要:本来可以直接利用eval函数将输入的string类型作为可执行语句执行,利用int()返回整数结果print(int(eval(input())))然而题目只要求实现两个整数的加、减、乘、除、取余五种…… 题解列表 2022年01月28日 0 点赞 0 评论 231 浏览 评分:9.9
python_模拟计算器 摘要:使用int()转换为整数类型,对应题目要求的整数运算a,b,c = input().strip().split() print(int(eval(a+c+b)))…… 题解列表 2022年01月28日 0 点赞 0 评论 360 浏览 评分:6.0
python-复数四则运算 摘要:解题思路:这道题理解起来不难,但是有两个细节要尤其注意。①开始我们要以浮点数读取所给的值,得出运算结果a+bi后,如果a和b的值是整数而不是小数,那么在输出时就要以整数的形式输出。②还有一个情况是题目…… 题解列表 2022年01月27日 0 点赞 0 评论 660 浏览 评分:9.9
python 容易理解 摘要:解题思路:注意事项:参考代码:ls =list(map(int,input().split()))while ls[0] != 0: lt = ls[1:] b=[] for i i…… 题解列表 2022年01月27日 0 点赞 0 评论 261 浏览 评分:0.0
python-概率计算 摘要:解题思路:动态规划建立数组dp = [max(n,a,b,x)+1][(n+1)] 注意这里不要直接写成dp = [x+1][n+1],因为在后面的计算中数组可能会越界,没修改前题测为91分其…… 题解列表 2022年01月27日 0 点赞 0 评论 525 浏览 评分:0.0
python-判断名次 摘要:解题思路:注意事项:参考代码:from itertools import permutations def f(): rst = tuple(permutations(&#…… 题解列表 2022年01月27日 0 点赞 0 评论 342 浏览 评分:2.0
编写题解 1131: C语言训练-斐波纳契数列 摘要:```python l=[1,1] n=int(input()) if n==1: print(l[0]) elif n==2: print('{} {}'.format(…… 题解列表 2022年01月27日 0 点赞 1 评论 399 浏览 评分:9.9