绕了好久,用数组方便,还是离不开for,累了哈哈 摘要:解题思路:建议用flag语句做判断,数组1、0开关注意事项:参考代码:#include<stdio.h>#define maxSize 50001int main(){ int arr[maxSize…… 题解列表 2023年01月19日 0 点赞 0 评论 445 浏览 评分:0.0
想了半天正确的while,纪念一下 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int n,i; float a,sum; while(scanf("%d",&n)!=EO…… 题解列表 2023年01月19日 0 点赞 0 评论 289 浏览 评分:0.0
挺有趣的哈哈这题目,这个代码有详细解读代码长 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int m,M,n,x,i; scanf("%d %d %d",&M,&n,&x); //M为最大体力值,n为…… 题解列表 2023年01月19日 0 点赞 0 评论 371 浏览 评分:0.0
whilewhilewhile,这个代码短,但是效率低一点,while还不熟练哈哈 摘要:解题思路:swap转换注意事项:参考代码:#include<stdio.h> int main() { int m, n, x; scanf("%d %d %d", &m, &n…… 题解列表 2023年01月19日 0 点赞 0 评论 283 浏览 评分:0.0
while循环又来咯,这个还是除余思想 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,k=0; //k,1的个数 scanf("%d",&n); for(int …… 题解列表 2023年01月19日 0 点赞 0 评论 383 浏览 评分:0.0
不用数组,用for直接循环 摘要:解题思路:因为第一个数字开始往后数,在for循环语句中用两个变量啊a,b,a不变,从前往后小于b即可注意事项:一定要初始i,不然不得行参考代码:#include <stdio.h>#include <…… 题解列表 2023年01月19日 0 点赞 0 评论 404 浏览 评分:0.0
分情况讨论,画矩形啥都行 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int x,y,n,i,j; char z; scanf("%d %d %c %d",&x,&y,&z,&n);…… 题解列表 2023年01月19日 0 点赞 1 评论 467 浏览 评分:9.9
3025: 踩方格(dfs) 摘要:解题思路:n不超过20,先写一个dfs爆搜。因为是二维数组,所以把只能向上、左、右走改成了向下、左、右走,起始位置在(0,50),这样向下左右走不会超过边界。先将起始位置标记为-1,表示不能返回。以走…… 题解列表 2023年01月19日 0 点赞 0 评论 526 浏览 评分:9.9
1444: 蓝桥杯2014年第五届真题-斐波那契 摘要:```cpp #include #include using namespace std; typedef long long LL; LL llmul(LL a,LL b,LL mod) …… 题解列表 2023年01月19日 1 点赞 0 评论 548 浏览 评分:9.9
1649: 蓝桥杯算法训练VIP-特殊的数字四十 摘要:解题思路:创建一个for循环,里面套一个for循环和一个if判断。注意事项:参考代码:for i in range(1000,10000): cnt = 0 for j in str(i)…… 题解列表 2023年01月19日 0 点赞 0 评论 350 浏览 评分:0.0