题解列表
计算一个整数N的阶乘-python
摘要:解题思路:递归解法,注意n=0的情况,阶乘也是1.注意事项:参考代码:def factorial(n):
if n == 0:
return 1
elif n =……
自定义函数求一元二次方程
摘要:解题思路:注意事项:参考代码:void root1(float a, float b, float delta){ float m1=-(b/2/a); float m2= (pow(de……
小心:一系列整数可能会有相同的数
摘要:解题思路:注意事项:参考代码:#include <iostream>#include <algorithm>#include <vector>using namespace std;struct tr……
编写题解 3047: Crossing River
摘要:```python
global times
times=[]
def crossingriver(p_list):
p_list.sort()#顺序排列
time=0#……
python编写题解 2792: 三角形判断
摘要:解题思路:三角形的三边关系:任意两边之和大于第三边或者任意两边之差小于第三边。参考代码:a, b, c = map(int, input().split())
if a+b > c and a+c ……
python编写题解 1039: [编程入门]宏定义之闰年判断
摘要:解题思路:普通年能被4整除且不能被100整除的为闰年,世纪年能被400整除的是闰年参考代码:def LEAP_YEAR(year):
if year % 4 == 0 and year % ……
python编写题解 2793: 点和正方形的关系
摘要:解题思路:求x,y的区间注意事项:判断一个给定的点是否在这个正方形内参考代码:x, y = map(int, input().split())
if x >= -1 and x <= 1 and y……