题解列表

筛选

一直不习惯用while,这次解出来啦

摘要:解题思路:用while语句,if判断语句,奇数的判断方法语句余数不为零即可注意事项:别忘了题目给的数字范围哦参考代码:#include "stdio.h"int main(){ int m,n; in……

完数的判断 c++代码

#include#include#includeusingnamespacestd;signedmain(){ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);intn;cin>>n;for(inti=2;i

线性筛解法,时间复杂度仅为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(

c++语言解决电报加密

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstdio>#include<string.h>using namespace std;void get(char……

简简单单无脑列举

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;void GetReal(float x){ cout << x << endl;}void ……

水题目,只需一个bool

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;bool is_leap(int y){ return y%4 == 0 && y % 100……