题解列表

筛选

巧妙处理素数问题(python)

摘要:解题思路:将因子输入列表中,元素个数仅为2时,判定为素数。注意事项:参考代码:def f(n):    s=[]    for i in range(1,n+1):        if n%i==0:……

链表插入的两种姿势,中间插入和尾插

摘要:解题思路:先构建两个链表,然后按照链表内的学号进行升序排序,这里我的思路是每次插入前找到比链表2待插入的节点学号大的节点,然后进行插入注意事项:参考代码:#include<stdio.h>#inclu……

jiechenheshu11111111000

摘要:解题思路:注意事项:参考代码:#include "stdio.h"#include  "math.h"int  J(int n) //求阶乘{ if (n == 1||n==0)return 1; i……

[编程入门]三个数最大值 Python解决

摘要:解题思路:    使用倒序,sort函数注意事项:    sort的参数reverse=False是升序,也是默认的,True为降序参考代码:        a = list(map(int,inpu……

[竞赛入门]简单的a+b Python解决

摘要:解题思路:    简单的加法,使用while循环即可参考代码:    while True:            n = list(map(int,input().split()))        ……