优质题解 与2无关的数(C语言)(详细解析)(内含两个求位数算法) 摘要:解题思路:核心:写出代码判断某个数能不能被2整除且该数的所有位数上是否含2。注意事项:求解整数各个位数的值的算法用得很多,以后遇到类似的需求可以直接套用。从个位数开始拆分整数的算法:void fuct…… 题解列表 2022年03月17日 0 点赞 0 评论 1263 浏览 评分:5.7
C++题解,重点弄清题意 摘要:解题思路:注意事项:分糖果的时候是全部小朋友同时分的参考代码:#include<iostream>using namespace std;const int N = 100;int n;int a[N…… 题解列表 2022年03月17日 0 点赞 0 评论 380 浏览 评分:0.0
字符串比较 摘要:解题思路:注意事项:sort函数可以比较字符串的大小参考代码:a=input().split()b=[]for i in a: b.append(i)b.sort()if b[0]==b[1] …… 题解列表 2022年03月17日 0 点赞 0 评论 778 浏览 评分:9.9
新手编写,请批评指正 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h> int main(){ int a,b,t=0; scanf("%d%d",&a,&b);…… 题解列表 2022年03月17日 0 点赞 0 评论 509 浏览 评分:6.0
汉诺塔 巧妙的递归 摘要:参考了许多人的答案,递归这个方法实在巧妙 **从整体入手,找子问题,再由子问题逐层上升** ```cpp #include #include using namespace std; in…… 题解列表 2022年03月17日 0 点赞 0 评论 626 浏览 评分:9.9
简单的结构体定义 摘要:解题思路:定义一个结构体判断平年还是闰年取值输出即可注意事项:函数内一定加struct参考代码:#include<stdio.h>struct shijian//定义一个结构体{ int yea…… 题解列表 2022年03月18日 0 点赞 0 评论 435 浏览 评分:0.0
那个顺序放在后面还要好好理解一下 摘要:解题思路:也是看了题解注意事项:写在代码里面了参考代码:#include<stdio.h>int main(){ float m,n,sum=0,i=0,t; scanf("%f %f",&m,&n)…… 题解列表 2022年03月18日 0 点赞 0 评论 402 浏览 评分:8.0
[编程入门]利润计算 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(void){ int i; scanf("%d", &i); if (i <= 100000) …… 题解列表 2022年03月18日 0 点赞 0 评论 491 浏览 评分:6.7
(fly)1813: 蓝桥杯算法提高- c++_ch03_02(python代码) 摘要:解题思路:注意事项:参考代码:n=int(input()) if n ==1: ls=[[1]] if n ==2: ls=[[1],[1,1]] if n >2: …… 题解列表 2022年03月18日 0 点赞 0 评论 505 浏览 评分:9.9
yolo_mm 用筛法求之N内的素数 摘要:解题思路: 常规筛,把倍数筛去注意事项: i*i 而不是从2倍筛起,比如i=5,如果是两倍则在i=2的时候就已经筛去了参考代码:#include<bits/stdc++.h>using …… 题解列表 2022年03月18日 0 点赞 0 评论 451 浏览 评分:0.0