题解: 公交汽车【Python】 摘要:解题思路:动态规划。参考代码:cost = list(map(int, input().split())) n = int(input()) dp = [0 for i in range(n)] …… 题解列表 2022年12月03日 0 点赞 0 评论 392 浏览 评分:9.9
题解: 数字三角形【Python】 摘要:解题思路:动态规划参考代码:N = int(input()) dp = [] for i in range(N): row = list(map(int, input().split()…… 题解列表 2022年12月03日 0 点赞 0 评论 556 浏览 评分:9.9
二维数组右上左下遍历 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int m,n,i,j,k; scanf("%d %d",&m,&n); int a[m][n…… 题解列表 2022年12月03日 0 点赞 0 评论 550 浏览 评分:4.7
最大数位置 摘要:解题思路:先用数组存储数据,然后将第一个值定为最大值,利用循环遍历数组和最大值比较如果大于最大值,将这个值赋值为最大值。注意事项:输出的i要加一参考代码:#include<stdio.h>#inclu…… 题解列表 2022年12月03日 0 点赞 2 评论 1203 浏览 评分:9.9
C语言 最小绝对值& 摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <math.h>#define LONG 10int main(){ int nums[LONG] …… 题解列表 2022年12月03日 0 点赞 0 评论 331 浏览 评分:0.0
冒泡排序法C语言 摘要:解题思路:冒泡排序法注意事项:注意i和j的使用。参考代码:#include<stdio.h>#include<stdlib.h>int main(){ int n,num[100]; in…… 题解列表 2022年12月03日 0 点赞 0 评论 1306 浏览 评分:9.9
这个方法还不错! 摘要:解题思路:对于本体解法,这里将运用结构体struct将10个数从大到小依次排列注意事项:malloc参考代码:#include<stdio.h> #include<malloc.h> #defin…… 题解列表 2022年12月03日 0 点赞 0 评论 454 浏览 评分:9.9
2790: 分段函数 摘要:解题思路:注意事项:参考代码:import sysx = float(input())if x < 0 or x >= 20: sys.exit()elif x < 5: print(&#…… 题解列表 2022年12月03日 0 点赞 0 评论 451 浏览 评分:0.0
递归法求最大公约数 摘要:最大公约数,采用辗转相除法,即对于a y) { c = x % y; if (c)return yue(y, c); else return y;…… 题解列表 2022年12月04日 0 点赞 0 评论 475 浏览 评分:9.9
母牛的故事 摘要:这道题第一次交的时候没有申清题意做错了,新出生的小母牛过了三年也就是第四年初从这以后每年年初都能生一头小母牛。分析:要先搞明白一头小母牛出生那年算起过几年?可以具有生育能力(根据题意三年)例:第二年出…… 题解列表 2022年12月04日 0 点赞 0 评论 420 浏览 评分:7.3