问题:
问题分析:主要考虑3*3的产品问题,结合实现的代码想一下,或则是想一下再结合代码
编一下代码:
#include <stdio.h> void main() { int N, a, b, c, d, e, f, y, x; int u[4] = {0, 5, 3, 1}; scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f); if (0 == a || b || c || d || e || f) { return; } N = f + e + d + (c + 3)/4; y = 5*d + u[c%4]; if(b > y) { N += (b - y + 8)/9; } x = 36*N - 36*f -25*e - 16*d - 9*c - 4*b; if(a > x) { N += (a - x + 35)/36; } printf("%d\n", N); }
读书-算法《程序设计导引及在线实践》-简单计算题5:装箱问题,布布扣,bubuko.com
读书-算法《程序设计导引及在线实践》-简单计算题5:装箱问题
原文:http://www.cnblogs.com/redkoodoo/p/3763664.html