题解列表

筛选

1029-自定义函数处理素数

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cmath>using namespace std;bool isPrime(int n){ bool flag=t……

先这样再那样

摘要:```c #include int gcd(int m,int n){ return (m%n==0)?n:gcd(n,m%n); } int lcm(int m,int n){ ……

Sn的公式求和

摘要:解题思路:递归注意事项:参考代码:#include <stdio.h> #include <math.h> int fun(int n){  // 使用递归得到每一项数字     if(n==1……

字符串分类统计

摘要:解题思路:数字字符在‘0’-‘9’之间,英文字符在‘a’-‘z’和‘A’-‘Z’之间,空格为‘ ’注意事项:在输入字符的时候用gets(),scanf会把空格当作是连个单词的分隔符参考代码:#incl……

1026-数字逆序输出

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a[10]; for(int i=0;i<10;i++)   ……

最大公约数与最小公倍数

摘要:解题思路:首先找出两个数字的大小并将其分开赋值给相应的变量,以便区分大小;两个数最大公约数的范围在 1-最小值 之间;两个数最小公倍数的范围在 最大值-最小值*最大值 之间;注意事项:参考代码:#in……