筛选N以内的素数 摘要:解题思路:注意事项:参考代码:def is_prime(num): if num < 2: return False for i in range(2, int(num **…… 题解列表 2023年12月07日 0 点赞 0 评论 504 浏览 评分:0.0
百钱百鸡问题 摘要:解题思路:注意事项:参考代码:def buy_chicken(): solutions = [] # 存储所有解的列表 for cock in range(0, 21): # 公鸡的取…… 题解列表 2023年12月07日 0 点赞 0 评论 530 浏览 评分:0.0
哥德巴赫曾猜测 摘要:解题思路:注意事项:参考代码:# 判断是否是素数def is_prime(n): if n < 2: return False for i in range(2, int(n…… 题解列表 2023年12月07日 0 点赞 0 评论 507 浏览 评分:0.0
getchar解决问题 摘要:解题思路:先输入再用字符比较注意事项:i与j的比较参考代码:#include <stdio.h>int main(){ int word = 0, number = 0, tab = 0, other…… 题解列表 2023年12月07日 0 点赞 0 评论 449 浏览 评分:0.0
题解 1120: C语言训练-"水仙花数"问题2 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int a,b,c; for(int i=100;i<100…… 题解列表 2023年12月07日 0 点赞 0 评论 444 浏览 评分:0.0
汉诺塔(python) 摘要:解题思路:注意事项:参考代码:def hanoi(n, a, b, c): if n > 0: hanoi(n - 1, a, c, b) print('mo…… 题解列表 2023年12月07日 0 点赞 0 评论 586 浏览 评分:0.0
判断元素是否存在 摘要:解题思路:注意事项:参考代码:def is_element_of_M(k, x): if k == x: return "YES" elif k > x: re…… 题解列表 2023年12月07日 0 点赞 0 评论 543 浏览 评分:0.0
因子分解(Python) 摘要:解题思路:注意事项:参考代码:def factorize_expression(n): factors = [] i = 2 while i * i <= n: if …… 题解列表 2023年12月07日 0 点赞 0 评论 490 浏览 评分:0.0
集合的划分 摘要:解题思路:注意事项:参考代码:def partition_count(n, k): dp = [[0] * (k+1) for _ in range(n+1)] for i in rang…… 题解列表 2023年12月07日 0 点赞 0 评论 726 浏览 评分:0.0
第一个带类的程序题解(Python代码) 摘要:class Date(object): def __init__(self,time): self.__year=0 self.__month=0 se…… 题解列表 2023年12月07日 0 点赞 0 评论 649 浏览 评分:0.0