自定义函数处理最大公约数与最小公倍数c++代码实现 摘要:# 自定义函数处理最大公约数与最小公倍数 **直接上代码:** ```cpp #include using namespace std; int gy(int n,int m){ i…… 题解列表 2022年08月26日 0 点赞 0 评论 398 浏览 评分:0.0
筛选N以内的素数c++代码实现 摘要:# 筛选N以内的素数c++代码实现 ###解题思路 **素数是什么?是除了1和本身之外,没有其他任何因数的数,所以我们只需要系一个程序,判断它是否有除1和本身之外的因数即可** ###代…… 题解列表 2022年08月26日 0 点赞 3 评论 367 浏览 评分:9.9
有规律的数列求和 摘要:# 有规律的数列求和c++代码实现 ### 解题思路: **通过观察,可发现一个数列:** **1 2 3 5 8 13 21** **像这种前两项相加等于第三项的数列叫做“斐波那…… 题解列表 2022年08月25日 0 点赞 0 评论 442 浏览 评分:0.0
完数的判断代码 摘要:# 完数的判断 - - - **直接上C++代码**: ```cpp #include//万能头 using namespace std; int a[10000];//用来存放因数 …… 题解列表 2022年08月25日 0 点赞 0 评论 389 浏览 评分:0.0
题目 1064: 二级C语言-阶乘数列 摘要:```cpp #include #include using namespace std; int main() { double sum = 0, t = 1; for…… 题解列表 2022年08月25日 0 点赞 4 评论 567 浏览 评分:8.0
题目 1063: 二级C语言-统计字符 摘要:``` #include #include using namespace std; int main() { string str; getline(cin, str)…… 题解列表 2022年08月25日 0 点赞 2 评论 796 浏览 评分:9.9
时间复杂度O(n),简单的数学题 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;#define maxn 10010int n,ans[maxn];int main…… 题解列表 2022年08月24日 0 点赞 0 评论 681 浏览 评分:9.9
时间复杂度O(1) 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;typedef long long ll;ll a,b,n,ans;int main…… 题解列表 2022年08月24日 0 点赞 0 评论 556 浏览 评分:9.9
一道简单的数学题(非常短且绝对能听懂) 摘要:解题思路:对于每一对恰好前后颠倒的排列(比如1 3 2 4与4 2 3 1),其价值和为n*(n-1)/2,可以自己尝试一下,会发现很好证明。一共有n!个排列,也就是n!/2对排列,所以答案就是n*(…… 题解列表 2022年08月24日 1 点赞 1 评论 1175 浏览 评分:8.7
质因数分解的模板题 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;typedef long long ll;ll n,ans;void getans(…… 题解列表 2022年08月24日 0 点赞 0 评论 929 浏览 评分:7.3