SStive39

OOP_k2l1v24

Sep 16th, 2021
662
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <cmath>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. double f (int n, double x) {
  7.     return n > 0 ? f(n-1, tan(n * M_PI_2 + x)) : x;
  8. }
  9.  
  10. int main() {
  11.     cout << f(5, 1) << endl;
  12.  
  13.     return 0;
  14. }
RAW Paste Data