12 lines
207 B
Plaintext
12 lines
207 B
Plaintext
|
#include <iostream>
|
||
|
int main() {
|
||
|
int a;
|
||
|
std::cin >> a;
|
||
|
double b = 1;
|
||
|
double c = 0.0;
|
||
|
for (int i = 1; i <= a; ++i) {
|
||
|
c += b / i;
|
||
|
b = -b;
|
||
|
}
|
||
|
std::cout << c << "\n";
|
||
|
}
|