题解列表
C++ 阶乘(递归做法)
摘要: #include ;
using namespace std;
long digui(long);//先声明
int main()
{
long a,num =0;/……
详细解释,阶乘末尾k位,小白写法,超容易懂!
摘要:首先,计算阶乘用数组模拟阶乘。
详细解析可以看;
https://blog.dotcpp.com/a/98223
会了数组模拟阶乘计算后,就可以按照题目的意思编程啦!
先附上注释版代码:……
使用for 循环语句
摘要:解题思路:注意事项:参考代码:#include<iostream>
using namespace std;
int main()
{
for (int n = 100; n < 1000;……
求和训练--简单易懂
摘要:解题思路:把各部分和先求出来,再总和相加。注意事项: 结果保留两位小数,求倒数和时,for循环中变量‘k’类型应设为float类型,其总和也应设为float类型参考代码:#include<iostr……
数组插入处理-sort排序
摘要:解题思路: 利用sort函数进行快速排序注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int a[11]; ……
最大公约数最小公倍数
摘要:解题思路:最大公约数肯定小于两数中较小的一个,最小公倍数肯定大于两数中较大的一个参考代码:#include<bits/stdc++.h> using namespace std; int main……
字符串分类统计----直接采用getchar()函数
摘要:解题思路:注意事项:参考代码:#include<iostream>
#include<string>
using namespace std;
int main()
{
int letter……
辗转相除法--简单易懂
摘要:解题思路:辗转相除法,又叫欧几里得算法是用来求两个正整数最大公约数的算法。古希腊数学家欧几里得在其著作《The Elements》中最早描述了这种算法,所以被命名为欧几里得算法。扩展欧几里得算法可用于……