自定义函数处理最大公约数与最小公倍数 摘要:解题思路:注意事项:参考代码: def yue(a,b): min =(a<b and a or b) i=min while i>0: if a%i==0 and…… 题解列表 2021年11月04日 0 点赞 1 评论 818 浏览 评分:9.9
[编程入门]三个数找最大值---两种方法---(Python) 摘要:Python 1.通过max求最大值: ```python list=list(map(int,input().split())) print(max(list)) ``` 2.通过if-…… 题解列表 2021年11月04日 0 点赞 0 评论 1654 浏览 评分:9.9
[编程入门]三个数最大值---两种方法---(Python) 摘要:Python 1.通过max求最大值: ```python list=list(map(int,input().split())) print(max(list)) ``` 2.通过if-…… 题解列表 2021年11月04日 0 点赞 0 评论 1003 浏览 评分:8.0
1255: 蓝桥杯算法提高-能量项链 DP解决 摘要: n = int(input()) a = list(map(int, input().split())) a.extend(a) a.append(a…… 题解列表 2021年11月04日 0 点赞 0 评论 730 浏览 评分:9.9
2^k进制数代码详细说明 摘要:解题思路:找到规律即可注意事项:主要要注意分段后可能剩下的不能组成k位的数值取值情况参考代码:import mathk,w=map(int,input().split())a=math.ceil(w/…… 题解列表 2021年11月03日 0 点赞 0 评论 573 浏览 评分:9.9
[编程入门]同因查找---for循环---(Python) 摘要:```python for i in range(10,1001): if i%2==0 and i%3==0 and i%7==0: print(i) ``` 通过…… 题解列表 2021年11月03日 0 点赞 1 评论 1081 浏览 评分:9.9
[编程入门]等差数列---for循环---(Python) 摘要:Python 每个数相差了3,所有每次循环对s都加上3用sum累加 ```python n=int(input()) sum=2 s=2 for i in range(1,n): …… 题解列表 2021年11月03日 0 点赞 0 评论 1300 浏览 评分:9.9
[编程入门]有规律的数列求和---for循环---(Python) 摘要:Python a等于b,b等于a+b ```python n=int(input()) a,b=1,2 sum1=0 for i in range(n): sum1+=float…… 题解列表 2021年11月03日 0 点赞 0 评论 535 浏览 评分:9.9
[编程入门]水仙花数判断---for循环---(Python) 摘要:Python 满足if条件为水仙花数将数值输出 ```python for i in range(100,1000): if i==((i%10)**3)+((i//10%10)**3…… 题解列表 2021年11月03日 0 点赞 0 评论 945 浏览 评分:6.7
[编程入门]求和训练---for循环---(Python) 摘要:```python a,b,c=map(int,input().split()) sum1=0 for i in range(1,a+1): sum1+=i for i in ran…… 题解列表 2021年11月03日 0 点赞 0 评论 718 浏览 评分:9.9