【C++最简单解法】 ‘&’位运算与的合理运用 摘要:解题思路:合理使用位运算与‘&’可以用来求二进制数的1的个数 num=num&(num-1);定义一个循环,当num!=0就继续循环例如:4&3 【位运算都是二进制补码参与运算】(前面的0省略不写…… 题解列表 2021年07月02日 0 点赞 0 评论 337 浏览 评分:9.9
小白来解题了,已经对了,请放心食用 摘要:解题思路:注意事项:参考代码:#include "stdio.h"/*-----函数申明区----可以不看----*/void drinks(int a[10]);int Exchange(int n…… 题解列表 2021年07月01日 0 点赞 1 评论 175 浏览 评分:9.9
自守数问题,数组解法 摘要:解题思路:注意事项:定义乘积用long long,,否则表示不出所有数,int表示范围不够参考代码:int main(){ long long i,temp,j,k,len,sq,count; …… 题解列表 2021年07月01日 0 点赞 0 评论 307 浏览 评分:0.0
题解 1074: 数字整除 摘要:参考代码:#include <stdio.h>#include <stdlib.h>int main(){ char s[200]; while(scanf("%s",s)!=EOF) …… 题解列表 2021年07月01日 0 点赞 0 评论 313 浏览 评分:0.0
[编程入门]自定义函数之数字分离 摘要:将每个数字看做是一个字符,打印输出即可 #include #include void Turn(char a,char b,char c,char d…… 题解列表 2021年07月01日 0 点赞 0 评论 240 浏览 评分:0.0
题解 1073: 弟弟的作业 摘要:利用scanf()函数,输入格式正确时加1;输入4个数据,默认前3个符合;取决于第四个是数字还是‘?’;数字时,k=4;‘?’时,k=3;还有k=EOF,即-1;参考代码:#include <stdi…… 题解列表 2021年07月01日 0 点赞 0 评论 218 浏览 评分:0.0
1028: [编程入门]自定义函数求一元二次方程 void函数解法 摘要: ** rwa——实部; ima——虚部; del——δ; ** 注意保留三位小数; #include #include #include …… 题解列表 2021年06月30日 0 点赞 0 评论 355 浏览 评分:0.0
题解 1027: [编程入门]自定义函数处理最大公约数与最小公倍数 只需一个函数 摘要: #include #include #define N 1000 int Fac(int a,int b) { i…… 题解列表 2021年06月30日 0 点赞 0 评论 292 浏览 评分:0.0
求素数问题 摘要:解题思路:注意事项:参考代码:int main(){int i,j,n,k;scanf("%d",&n);for(i=2;i<=n;i++){ k=0; for(j=2;j<i;j++){…… 题解列表 2021年06月30日 0 点赞 0 评论 192 浏览 评分:0.0
求矩阵的两对角线上的元素之和规律法 摘要:解题思路:i,j->a[i][j]n=3对角线1:0,0+1,1+2,2对角线2:0,2+1,1+2,0总和=对角线1+对角线2-1,1;n=4对角线1:0,0+1,1+2,2+3,3对角线2:0,3…… 题解列表 2021年06月30日 0 点赞 0 评论 267 浏览 评分:0.0