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.
14 lines
235 B
14 lines
235 B
2 years ago
|
#include <iostream>
|
||
|
|
||
|
using namespace std;
|
||
|
|
||
|
int main() {
|
||
|
double n = 100, s = 0;
|
||
|
for (int i = 1; i <= 10; ++i) {
|
||
|
s += n + n / 2;
|
||
|
n /= 2;
|
||
|
}
|
||
|
s -= n;
|
||
|
printf("%lf\n%lf", s, n);
|
||
|
return 0;
|
||
|
}
|