Question: Write a C program about 4 pirates. The pirates want to compete for the 1000 pearls that are in the cave. - Two of the
Write a C program about 4 pirates. The pirates want to compete for the 1000 pearls that are in the cave.
- Two of the pirates only know the password "Open, sesame!".
- The other two only know the password "Open, watermelon!".
- The two who use "Open, sesame!" to open the cave can get 10% of the remaining pearls each time.
- The two who use "Open, watermelon!" to open the cave can get 15% of the remaining pearls.
- When one pirate is in the cave, another pirate cannot get in.
- If 10% or 15% of the pearls is not an integer, round it up to the ceiling integer. For example, if the result is 3.14 pearls, the pirate can get 4 pearls.
- Once all the pearls are gone from the cave, print out the number of pearls each pirate has and terminate the program.
* I need this as soon as possible please
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
