A,B,C,D,E合伙抓鱼,全都睡着了。A第一个起来,将鱼分成5份,把多余的一条扔回河里,拿走自己一份走了。B第二个起来,又把鱼分成5份,把多余的一条扔回河里,拿走自己一份走了。接着,C,D,E都同样做。问渔夫们一共至少抓了多少条鱼?
1: #include "stdio.h"
2:
3: int getfish(int init, int n)
4: {
5: int s = init;
6:
7: while(n)
8: {
9: s = 5 * s + 1 ;
10: n--;
11: }
12:
13: return s;
14: }
15:
16: int main()
17: {
18: printf("Fish which were gotten by fishers at least are %d", getfish(6, 4));
19: return 0;
20: }