Master to advise ~! C procedures solve a problem that is not difficult!

xiaoxiao2021-03-06  63

With

1G, 2G, 3G, 5G, 10G, 20G

Some of the weights (total weight

<= 1000g

), Require: Input mode:

A1 A2 A3 A4 A5 A6 (

Indicate

1G

Weight

A1

A,

2G

Weight

A2

A,

...

20G weight has A6);

Output method: total = n (n means a number of different weights that can be referred to with these weights, but no need to extend a weight is not used);

Such as: Enter: 1 1 0 0 0 0

Output: Total = 3 indicates three different weights of 1G, 2G, 3G.

转载请注明原文地址:https://www.9cbs.com/read-111620.html

New Post(0)