1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-27 08:26:20 +00:00
202401-programming-assignments/【额外练习】循环结构/7-3 循环-小智的捕食计划.c

18 lines
189 B
C
Raw Normal View History

2024-11-18 15:10:07 +00:00
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int a = 1;
for (int i = n; i > 2; i--) {
a = (a + 1) * 2;
}
printf("%d\n", a);
return 0;
}