C语言猴子吃桃

题目:

代码实现:

1
2
3
4
5
6
7
8
9
10
#include <stdio.h>
int main () {
int n = 0;
int peach = 1;
scanf("%d", &n);
for (int i = 1; i <n; i++) {
peach = (peach + 1) * 2;
}
printf("%d", peach);
}

C语言猴子吃桃
http://example.com/2023/08/20/C语言猴子吃桃/
Author
fwlw
Posted on
August 20, 2023
Licensed under