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.

27 lines
636 B

2 years ago
#include <bits/stdc++.h>
using namespace std;
//倒推
/**
0+1=1
:1÷2=1/2
1/2+1=3/2
3/2÷2=3/4
3/4+1=7/4
7/4÷2=7/8
7/8
*/
int main() {
double sum = 0;
for (int i = 0; i < 6; ++i) {
if (i % 2 == 0)
sum += 1;
else {
sum = sum / 2;
}
}
cout << sum << endl;
return 0;
}