蓝桥杯基础练习VIP-Huffuman树Python版 摘要:解题思路:注意事项:参考代码:#蓝桥杯基础练习VIP-Huffuman树Python版 n=int(input()) A=list(map(int,input().strip().split())…… 题解列表 2022年03月26日 0 点赞 0 评论 455 浏览 评分:7.0
1059: 二级C语言-等差数列 摘要:解题思路:等差数列求和:Sn = a1 * n + [n * (n - 1) * d] / 2 或 Sn = [n * (a1 + an)] / 2。注意事项:带了一句异常处理,检测到输入不合法的数(…… 题解列表 2022年03月28日 0 点赞 0 评论 568 浏览 评分:7.0
绝对值排序-C语言代码 摘要:解题思路:用动态内存分配。注意事项:循环条件要用scanf("%d",&n)!=EOF。参考代码:#include<stdio.h>#include<malloc.h>#include <stdlib…… 题解列表 2022年03月29日 0 点赞 0 评论 527 浏览 评分:7.0
四行代码 摘要:解题思路:注意事项:参考代码:def f(n): n=str(n) return int(n[::-1])n,m=map(int,input().split())print(f(f(n)+…… 题解列表 2022年03月30日 0 点赞 0 评论 454 浏览 评分:7.0
不用数组版C语言-计负均正 摘要:解题思路:输一个判断一个注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int n=0,m; double…… 题解列表 2022年04月01日 0 点赞 0 评论 514 浏览 评分:7.0
1187: 假币问题 摘要:解题思路:只要想清楚怎么做,剩下的代码就没问题,我之前想是平均分为两份,放入天平中,后来发现这种思路不是称量次数最少的方法,最好的做法便是分为3份注意事项:参考代码:#include<stdio.h>…… 题解列表 2022年04月02日 0 点赞 0 评论 738 浏览 评分:7.0
代码不长,for比较多,新手易懂 摘要:解题思路:将名次等价于分数,每家15分,9、8已经固定,7个数分为2、2、3组然后遍历注意事项:如下参考代码:#include<iostream>using namespace std; int…… 题解列表 2022年04月03日 0 点赞 0 评论 710 浏览 评分:7.0
统计字母个数 x=getchar() scanf("%c",&x) 摘要:#include int main() { char x,a[27]={"abcdefghijklmnopqrstuvwxyz"}; int b[26]={0}; while((x=ge…… 题解列表 2022年04月03日 0 点赞 0 评论 548 浏览 评分:7.0
绝对值排序 用数组 while(scanf("%d",&n)!=EOF&&n!=0) 摘要:#include <stdio.h> #include <math.h> int main() { int n,k; while(scanf("%d",&n)!=EOF&&n!=0){ …… 题解列表 2022年04月05日 0 点赞 0 评论 367 浏览 评分:7.0
优质题解 1069: 二级C语言-寻找矩阵最值 摘要:解题思路:(1)题目对于输入的二维矩阵只是要求找最大值,而找最大值的方法只是在每次输入值时进行比较和更新,故本题有个偷懒的写法:不建立二维数组,只需要用 for() 或者 while() 连续输入 n…… 题解列表 2022年04月16日 0 点赞 2 评论 2254 浏览 评分:7.0