Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3.  
  4. int main() {
  5.    
  6.     int n;
  7.  
  8.     std::cout << "Podaj n:\n";
  9.     std::cin >> n;
  10.    
  11.     double licznik = (n*(n+1))/2;
  12.     double m = 1;
  13.  
  14.     for (int i = 0; i < n; ++i) {
  15.         m = m*(2 + (i * 4));
  16.     }
  17.    
  18.     std::cout << licznik / m;
  19.    
  20.     _getch();
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement