Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <stdio.h>
- #include <conio.h>
- #include <math.h>
- #include <float.h>
- #include <locale.h>
- double FTWTRYHARD(const double a, const int n) {
- double temp = a;
- double result = 1.0 / a;
- for (int i = 1; i <= n; i += 1) {
- temp *= (a + i);
- result += 1.0 / temp;
- }
- return result;
- }
- int main() {
- int n;
- double a;
- scanf("%lf%i", &a, &n);
- printf("%.4f\n", FTWTRYHARD(a, n));
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement