0/1背包问题,递归求解,动态规划 摘要:朴素递归算法(时间超限)参考代码:#include <stdio.h> int t,m; typedef struct Item { int time; int va…… 题解列表 2019年01月06日 0 点赞 0 评论 648 浏览 评分:0.0
C语言程序设计教程(第三版)课后习题9.2 (C语言代码) 摘要:解题思路:把A%B用宏来定义注意事项:无参考代码:#include<stdio.h>#define t a%bint main(){ int a,b; scanf("%d %d",&a,&…… 题解列表 2019年01月06日 0 点赞 0 评论 615 浏览 评分:0.0
C语言程序设计教程(第三版)课后习题5.7 (C语言代码) 摘要:解题思路:用数组来保存每位数字,然后用循环输出数字注意事项:注意输出的格式参考代码:#include<cstdio>#include<iostream>using namespace std;int …… 题解列表 2019年01月06日 0 点赞 0 评论 393 浏览 评分:0.0
C语言程序设计教程(第三版)课后习题5.4 (C++代码) 摘要:解题思路:直接调用库函数注意事项:注意输出的格式参考代码:#include<cstdio> #include<algorithm> using namespace std; int main() { …… 题解列表 2019年01月06日 0 点赞 0 评论 567 浏览 评分:0.0
Minesweeper (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h> #include<string.h> int main(){ int count=1,n,m,i,j,k,x,y; whi…… 题解列表 2019年01月06日 0 点赞 0 评论 736 浏览 评分:0.0
C语言程序设计教程(第三版)课后习题1.5 (C语言代码) 摘要:解题思路:直接按照输入priintf函数执行,按照题目要求注意事项:注意空格和换行参考代码:#include<stdio.h>int main(){printf("******************…… 题解列表 2019年01月06日 0 点赞 0 评论 395 浏览 评分:0.0
[编程基础]输入输出练习之精度控制3 (C语言代码) 摘要:解题思路:先想好每个数字是什么类型编写注意事项:这题我折腾了好久,始终找不到失败的原因,回去看了下视频,回来再写还是错。再仔细审题,发现有个坑:C不是数字,不能给它占用4个字符宽!然后再编,终于过去!…… 题解列表 2019年01月06日 1 点赞 4 评论 865 浏览 评分:7.3
C语言训练-"水仙花数"问题1 (C语言代码) 摘要:解题思路:每次用模取一位,之后用除法删除已经取过的位数。注意事项:参考代码:#include<stdio.h>int main(){ int a,b,sum=0; scanf("%d",&a); b=…… 题解列表 2019年01月06日 0 点赞 0 评论 653 浏览 评分:0.0
汽水瓶 (C++代码) 摘要:解题思路:利用递归算法,因每次手中空瓶子数目换汽水的计算方法一样所以可以归纳出公式啦注意事项:参考代码:#include<iostream>void solve(int n);using namesp…… 题解列表 2019年01月06日 0 点赞 0 评论 761 浏览 评分:0.0
明明的随机数 (C++代码) 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<algorithm>using namespace std;int main(){ int n,a[100],i,j…… 题解列表 2019年01月06日 0 点赞 0 评论 675 浏览 评分:0.0