C语言训练-斐波纳契数列 摘要:解题思路:注意事项:参考代码:mylist = [1,1]n = int(input())sum = 0if n==1: print(mylist[0])elif n>1: for i i…… 题解列表 2024年03月11日 0 点赞 0 评论 360 浏览 评分:9.9
1106: 奖学金(一个对象,多个数据,用结构体) 摘要:解题思路:结构体的应用注意事项:参考代码:#include<iostream>using namespace std;struct st{ int xh; int a,b,c; in…… 题解列表 2024年03月11日 2 点赞 0 评论 549 浏览 评分:9.9
1105: 数列(找出根本找不出的规律) 摘要:解题思路:十进制转换为二进制,次方注意事项:参考代码:#include<iostream>#include<cmath>using namespace std;int main(){ int k…… 题解列表 2024年03月11日 0 点赞 0 评论 433 浏览 评分:9.9
移动路线java 摘要:解题思路:注意事项:参考代码:import java.util.Scanner; public class Main { public static void main(String[…… 题解列表 2024年03月11日 0 点赞 0 评论 314 浏览 评分:0.0
用冒泡排序做的,没有时间超限 摘要:解题思路:注意事项:参考代码:while True: li=list(map(int,input().split())) if li[0]==0: break else…… 题解列表 2024年03月11日 0 点赞 0 评论 311 浏览 评分:0.0
1102: 明明的随机数(基础,思路简洁,有意思) 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>//用于sort函数using namespace std;int main(){ int…… 题解列表 2024年03月11日 1 点赞 0 评论 355 浏览 评分:9.9
借助数组实现变化,注意下标 摘要:解题思路:注意事项:参考代码:#include<stdio.h>void main(){ const int l; int m,i,to,wei; int sum=0; scanf("%d",&l);…… 题解列表 2024年03月11日 0 点赞 0 评论 334 浏览 评分:0.0
1103: 开心的金明(模型题) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int value[100],cost[1000];int dp[50000];//数组尽量搞…… 题解列表 2024年03月11日 1 点赞 0 评论 459 浏览 评分:9.9
有点小乱,仅供参考 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int jue(int a){ if(a<0) return -(a); else return a;}void main(){ int…… 题解列表 2024年03月11日 0 点赞 0 评论 416 浏览 评分:0.0
1100: 采药(dp数组,动态规划,01背包) 摘要:解题思路:这段代码使用动态规划解决了一个背包问题。首先,定义了两个数组cost和value,分别用来存储每个物品的费用和价值。同时定义了一个dp数组,用来存储背包在不同容量下的最大价值。接下来,通过c…… 题解列表 2024年03月11日 1 点赞 0 评论 751 浏览 评分:9.9