githubNonFunziona/2-3-g.spp
2024-12-05 13:57:14 +03:00

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";
}