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

18 lines
189 B
C

#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;
}