We want to send a postcard by mail. We need to stamp worth cents (). Stamps have values 7 and 4 cents. As space is limited we want to know the minimum number of stamps we need to put on the postcard, without losing a cent.
Using the definition
struct Stamps {
int stamp7;
int stamp4;
};
implement a recursive function
Stamps min_stamps(int n)
computing the mimimum number of necessary worth 7 stamps (stamp7 field) and worth 4 stamps (stamp4 field) for a total worth of cents (. For instance, for , the result fields of min_stamps must be 6 and 4.
In order to complete the recursive case, note that recursive calls will always provide a Stamps tuple with stamp4 field at most 6.
This problem is an example about using tuples in order to define functions computing a result that does not have a default representation as a single value.
You only need to submit the required classes; your main program will be ignored.
Strictly obey the type definitions of the statement.