You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
388 B

#include <bits/stdc++.h>
using namespace std;
//思路:
//(1)倒推
//(2)用实例总结通项公式
int main() {
//第十天 1
//第九天 1*2+2=4
//第八天 4*2+2=10
//第七天 10*2+2=22
//第六天 22*2+2=46
int sum = 1;
for (int i = 2; i <= 10; i++) {
sum = sum * 2 + 2;
}
cout << sum << endl;
return 0;
}