Hifipsysta-1137题-C语言训练-求函数值(C++代码)普通递归法 摘要:```cpp #include using namespace std; int func(int x){ int y=0; if(x==1){ y=1…… 题解列表 2022年01月30日 0 点赞 0 评论 213 浏览 评分:0.0
Hifipsysta-1133题-C语言训练-求1+2!+3!+...+N!的和(C++代码)双函数法 摘要:```cpp #include using namespace std; long long int fact(int n){ long long int prod=1; …… 题解列表 2022年01月30日 0 点赞 0 评论 399 浏览 评分:0.0
Hifipsysta-1122题-C语言训练-亲密数(C++代码)缩小样本空间法 摘要:解题思路: ① 本题如果将A和B写进两个循环同时遍历,运算复杂度会非常高基本在$$O(n^2)$$量级,因此需要考虑的是如何缩小样本空间。 ② 3000以内的任意一个整数都可能成为或者说有资格成为…… 题解列表 2022年01月30日 0 点赞 0 评论 412 浏览 评分:0.0
蓝桥杯算法提高VIP-特殊的质数肋骨(找规律--->打表) 摘要:# 当n为1的时候:答案为2,3,5,7; 当n为2的时候:答案为(可以写暴力看一看,暴力应该可以算到6); 不难发现每次都是在n-1的基础上用1,3,7,9和n-1中每个数进行组合 通过前面…… 题解列表 2022年01月30日 0 点赞 0 评论 412 浏览 评分:9.9
Hifipsysta-1094题-字符串的输入输出处理(C++代码)比较简洁的字符串算法 摘要:```cpp #include #include using namespace std; int main(){ int N; scanf("%d",&N); …… 题解列表 2022年01月30日 0 点赞 0 评论 227 浏览 评分:0.0
Hifipsysta-1084题-用筛法求之N内的素数(C++代码)面向对象的遍历法 摘要: ```cpp #include using namespace std; bool is_prime(int num){ for(int i=2;i…… 题解列表 2022年01月30日 0 点赞 0 评论 217 浏览 评分:0.0
宏定义的 语句代替使用+两变量交换法(内存不同位置时) 摘要:解题思路:利用宏定义交换变量x和y的值;注意事项:运用两变量交换法注意两变量必须拥有不同的内存地址,否则使用后值均为0参考代码:#include <stdio.h>#define Swap(a,b) …… 题解列表 2022年01月30日 0 点赞 0 评论 292 浏览 评分:0.0
Hifipsysta-1204题-大小写转换(C++代码)cctype很简单 摘要:```cpp #include #include #include using namespace std; int main(){ string str; whil…… 题解列表 2022年01月30日 0 点赞 0 评论 488 浏览 评分:9.9
Hifipsysta-1124题-C语言训练-大、小写问题(C++代码)7行代码搞定 摘要:```cpp #include #include #include using namespace std; int main(){ string str; getl…… 题解列表 2022年01月30日 0 点赞 0 评论 185 浏览 评分:0.0
Hifipsysta-1118题-Tom数(C++代码)字符串法 摘要: ```cpp #include #include #include using namespace std; int main(){ string str; wh…… 题解列表 2022年01月30日 0 点赞 0 评论 245 浏览 评分:0.0