17 lines
450 B
C
17 lines
450 B
C
#include <stdio.h>
|
|
|
|
int nextMonth(int currentMonth, int lastMonthAdult, int lastMonthChild) {
|
|
if (currentMonth == 7) {
|
|
return lastMonthAdult + lastMonthChild;
|
|
}
|
|
else {
|
|
return nextMonth(currentMonth + 1, lastMonthAdult + lastMonthChild, lastMonthAdult);
|
|
}
|
|
}
|
|
|
|
int main() {
|
|
int sheepCount = 0;
|
|
sheepCount = nextMonth(1,0,2);
|
|
printf("Number of sheep: %d\nValue: %d", sheepCount, sheepCount*10);
|
|
return 0;
|
|
} |