/* Andras Konya 9/23/01 Chapter 3 Exercise 11B --- Pots Shipments with Int Math*/ #include int main () { long pots; cout << "Enter the number of pots to ship: "; cin >> pots; cout << "We will ship: " << endl; cout << " " << pots/9 << " very big box(s)." << endl; // ( # of boxes needed per big box) cout << " " << (pots-((pots/9)*9)) /4 << " big box(s)." << endl; // Equation for number of LB's needed same as above. // VBB = very big boxes , BB = big boxes, SB = small boxes // pots - (pots/9) * 9 / 4 // (Tot. pots) - (# of VBB needed)*(# pots in VBB) / (# of pots in LB) // { ( # of pots in VBB) } // { # of possible pots in LB } cout << " " << (pots)- (((pots/9)*9) + (((pots/9)*9)/4)); cout << " small boxes(s)." << endl; // Equation for number of SB's needed same as above. // VBB = very big boxes , BB = big boxes, SB = small boxes // pots - ((pots-((pots/9)*9))+((pots-((pots/9)*9))/4)) %4 // (Tot. pots) - ((# of pots in VBB)+(# of pots in BB)) % (# of pots in SB) // { (# of pots in VBB + BB) } // { (# of pots possible in SB) } char dummy; cin >> dummy; return (0); }