Advertisement
DasShelmer

5.1.19

Oct 13th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4.  
  5. int main() {
  6.     setlocale(LC_ALL, "Russian");
  7.     int n, i;
  8.     double S = 0.0, Ssin = 0.0;
  9.     cout << "Введите значение n (n > 0): ";
  10.     cin >> n;
  11.     for (i = 1; i <= n; i++) {
  12.         Ssin += sin(i);
  13.         S += 1 / Ssin;
  14.     }
  15.     printf("S: %6.14lf", S);
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement