题解列表

筛选

蓝桥杯算法训练-二进制数数

摘要:解题思路:利用二进制取反和与操作找到最右边1的位置,然后减掉,后面在以此类推注意事项:参考代码:#include<iostream>using namespace std;int lowbit(int……

简单明了的解题法

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a,n; double z=0,x=0,c=0,v=0; scanf("%d",&n); for(int……

c语言代码解决问题

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<stdlib.h>int huffuman(int* a, int n){ int i, m1 = 1000001, ……

利用区间合并的思想求解

摘要:解题思路: 将区间合并之后即可解决区间重合问题注意事项: 注意数据类型参考代码:#include<iostream>#include<algorithm>#include<vector>using n……

自定义函数判断一个数是不是素数

摘要:解题思路:一个数除了1和它本身再也没有其他可以整除的数就做素数,则可用for循环从i=1到i<=x来判断注意事项:参考代码:#include<stdio.h>void judge(int x){   ……

3x3数组的转置(简单代码)

摘要:解题思路:原来:(ij)  00 01 02    转置后: (ij)00    10    20                           

1777: 循环练习之完美数判断

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; int main() {     int  n;     int j=0;  ……

C语言代码解决问题

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int f(int n){    if(n==1||n==2)    {        return 1;    }    else  ……

1781: 登陆验证问题(一)

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; int main() {     string str1,str2;     c……

最大公约数与最小公倍数

摘要:解题思路:用辗转相除法求最大公约数,在求出最小公倍数。最后再调用函数即可。注意事项:参考代码:#include<stdio.h>int f(int a,int b){    if(b==0)    r……