今天学习了如何运用逆推法
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int x = 1;
for (int i = 1; i < n; i++) {
x = (1 + x) * 2;
}
printf("%d", x);
return 0;
}
运行结果如下:
10
1534
--------------------------------
Process exited after 4.033 seconds with return value 0
请按任意键继续. . .