Guest User

Untitled

a guest
Jun 9th, 2020
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1.  
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. double num(int n);
  8.  
  9. int main()
  10. {
  11. std::cout << "Wyraz 126 ciagu "<<num(126);
  12.  
  13. }
  14.  
  15.  
  16. double num(int n) {
  17. if(n==1)
  18. return 1;
  19. if(n==2)
  20. return 0.5;
  21. return -num(n-1)*num(n-2);
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment