Advertisement
mostlabs

11/1

Feb 25th, 2020
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. double al(double a,double b,int n)
  7. {
  8. if(n == 1)
  9.  return a;
  10.  
  11. return al(a*b,b,n-1);
  12. }
  13. int main()
  14. {
  15.    
  16.     int a,b=3,n=5;
  17.    
  18.     cin >> a;
  19.    
  20.     cout << al(a,b,n);
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement