code.cpp 362 B

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