一直不习惯用while,这次解出来啦 摘要:解题思路:用while语句,if判断语句,奇数的判断方法语句余数不为零即可注意事项:别忘了题目给的数字范围哦参考代码:#include "stdio.h"int main(){ int m,n; in…… 题解列表 2023年01月11日 0 点赞 0 评论 557 浏览 评分:0.0
想了几种办法,这种最耗时最少 摘要:解题思路:while循环语句,if判断语句注意事项:认真参考代码:#include "stdio.h"int main(){ int m,n; int sum=0; int num; scanf("…… 题解列表 2023年01月11日 0 点赞 0 评论 559 浏览 评分:0.0
完数的判断 c++代码 #include#include#includeusingnamespacestd;signedmain(){ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);intn;cin>>n;for(inti=2;i 题解列表 2023年01月11日 0 点赞 0 评论 456 浏览 评分:0.0
线性筛解法,时间复杂度仅为O(n) ###线性筛解法,时间复杂度仅为O(n)###```cpp#includeusingnamespacestd;constintN=1e6+5;intprimes[N],cnt;boolst[N];voidget_primes(intn){for(inti=2;in;get_primes(n);for( 题解列表 2023年01月11日 0 点赞 0 评论 504 浏览 评分:0.0
在后面的的往前面移,前面的直接往后面搬 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int n,m; scanf("%d",&n); int a[n-1]; int i …… 题解列表 2023年01月11日 0 点赞 0 评论 459 浏览 评分:0.0
c++语言解决电报加密 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstdio>#include<string.h>using namespace std;void get(char…… 题解列表 2023年01月11日 0 点赞 0 评论 446 浏览 评分:0.0
简简单单无脑列举 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;void GetReal(float x){ cout << x << endl;}void …… 题解列表 2023年01月11日 0 点赞 0 评论 455 浏览 评分:0.0
水题目,只需一个bool 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;bool is_leap(int y){ return y%4 == 0 && y % 100…… 题解列表 2023年01月11日 0 点赞 0 评论 437 浏览 评分:0.0
蓝桥杯算法训练-动态数组使用(C语言) 摘要:#include<stdio.h> #include<stdlib.h>//后面调用malloc函数需要引用头文件<stdlib.h> void fun1(int* p, int n) { …… 题解列表 2023年01月12日 0 点赞 0 评论 588 浏览 评分:0.0
c++ sort快排解决问题(签到) 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;int N = 2e2 + 5;int main(){ …… 题解列表 2023年01月12日 0 点赞 0 评论 497 浏览 评分:0.0