Page 1 of 1

Mark and Jane are very happy after having their first child. Their son loves toys, so Mark wants to buy some. There are

Posted: Mon May 09, 2022 6:10 am
by answerhappygod
Mark And Jane Are Very Happy After Having Their First Child Their Son Loves Toys So Mark Wants To Buy Some There Are 1
Mark And Jane Are Very Happy After Having Their First Child Their Son Loves Toys So Mark Wants To Buy Some There Are 1 (51.11 KiB) Viewed 44 times
Mark and Jane are very happy after having their first child. Their son loves toys, so Mark wants to buy some. There are a number of different toys lying in front of him, tagged with their prices. Mark has only a certain amount to spend, and he wants to maximize the number of toys he buys with this money. Given a list of toy prices and an amount to spend, determine the maximum number of toys he can buy. Note each toy can be purchased only once. • Input: Enter the dollar amount Mark can spend: 50 Enter the number of items: 7 Enter the toy prices: 1 12 5 111 200 1000 10 Output: Maximum number of items Mark can buy: 4 NOTES: you're not allowed to use any standard library functions in your solution.