修改文件结构。

This commit is contained in:
unlockable
2023-02-21 10:56:54 +08:00
parent a64cfdd9f3
commit 40182871f4
83 changed files with 0 additions and 0 deletions

17
POP/03/Exercise03.c Normal file
View File

@@ -0,0 +1,17 @@
#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;
}