-
-
Save tjk/3883055 to your computer and use it in GitHub Desktop.
ACM Micro-Challenge 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int | |
num_pizzas(unsigned int num_people, unsigned int slices_per_pizza, unsigned int time) | |
{ | |
unsigned int num_slices; | |
num_slices = num_people; | |
if (11 <= time && time <= 22) | |
num_slices *= 2; | |
return (int)(num_slices / (float)slices_per_pizza + 1); | |
} | |
int | |
main(void) | |
{ | |
return num_pizzas(5, 10, 22); // answer in $? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
woops forked this off of @jroesch instead of @andrewberls...