Advertisement
mostlabs

11/2

Feb 25th, 2020
380
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. #include<cmath>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. double al(double a)
  8. {
  9.   if(a == 1)
  10.  return a;
  11.  
  12.  return (pow(a,3) + al(a - 1));
  13. }
  14. int main()
  15. {
  16.    
  17.     int a;
  18.    
  19.     cin >> a;
  20.    
  21.     cout << al(a);
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement