题解列表

筛选

个人思路,随便看看吧

摘要:解题思路:学会列表的相关操作很重要注意事项:参考代码:def fun(n):    l1 = [n]    while n != 1:        if n % 2 == 0:           ……

1395: 倒数第二(STL multiset)

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<set>using namespace std;int main(void){     int i0,i,temp;……

递归求最小公倍数和最大公约数

摘要:解题思路:利用辗转相除法求最大公约数,再利用最大公约数和最小公倍数的关系求最小公倍数注意事项:参考代码:#include<stdio.h>int gcd(int m,int n){    if(m%n……