java动态规划(简单易懂) 摘要:解题思路:举个例子,假设我们有三个物品 A、B、C,以及背包容量分别为 5。在遍历物品 A 时,我们要计算背包容量为 5 时的最大价值,同时也要计算背包容量为 4、3、2、1、0 时的最大价值。然后在…… 题解列表 2023年09月01日 0 点赞 0 评论 199 浏览 评分:0.0
面向对象写 摘要:解题思路:注意事项:参考代码:class Time: def __init__(self): self.__h = 0 self.__m = 0 sel…… 题解列表 2023年09月01日 0 点赞 0 评论 559 浏览 评分:0.0
计算多项式的值(注意:输入顺序是x,a,b,c,d) 摘要:参考代码: ```c #include int main() { double a,b,c,d,x; scanf("%lf%lf%lf%lf%lf",&x,&a,&b,&c,&d); …… 题解列表 2023年09月02日 0 点赞 0 评论 186 浏览 评分:0.0
字符串分类统计----直接采用getchar()函数 摘要:解题思路:注意事项:参考代码:#include<iostream> #include<string> using namespace std; int main() { int letter…… 题解列表 2023年09月03日 1 点赞 0 评论 149 浏览 评分:0.0
最大公约数最小公倍数 摘要:解题思路:最大公约数肯定小于两数中较小的一个,最小公倍数肯定大于两数中较大的一个参考代码:#include<bits/stdc++.h> using namespace std; int main…… 题解列表 2023年09月03日 0 点赞 0 评论 179 浏览 评分:0.0
数组插入处理-sort排序 摘要:解题思路: 利用sort函数进行快速排序注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int a[11]; …… 题解列表 2023年09月03日 0 点赞 0 评论 186 浏览 评分:0.0
结构体之成绩记录(结构体指针) 摘要: 注意事项: 结构体变量用点(.)来访问成员的方法,结构体指针是通过箭头(->) 参考代码: ```c #include struct m { char sno[100…… 题解列表 2023年09月03日 0 点赞 0 评论 132 浏览 评分:0.0
自定义函数处理最大公约数与最小公倍数 摘要:解题思路:用两个数去余7,5,3,2,进入之后循环乘余数,两个数都能被余完说明已经找到最小公倍数了就退出,然后打印两个数都能余完进去的数,和两个数都能被余完的数。注意事项:循环从2开始不然都能直接进去…… 题解列表 2023年09月04日 0 点赞 0 评论 165 浏览 评分:0.0
简单明了的函数解法 摘要:解题思路:注意事项:参考代码:#include <stdio.h> #include <string.h>fan(char a[],int n){int i; for (i …… 题解列表 2023年09月04日 0 点赞 0 评论 159 浏览 评分:0.0
苹果和虫子(用if解决这类问题) 摘要: 注意事项: 注意变量类型,有几道题都这个套路 参考代码: ```c #include int main() { int n,x,y; scanf("%d%d%d",&n,&…… 题解列表 2023年09月05日 0 点赞 0 评论 199 浏览 评分:0.0