123456789101112131415 |
- /* Create a function that determines whether or
- not it's possible to split a pie fairly given these three parameters:
- Total number of slices.
- Number of recipients.
- How many slices each person gets.
- The function will be in this form: */
- bool equalSlices(int total, int people, int each) {
- if (people==0) {
- return true;
- }
- return (total/people) >= each;
- }
|