Risonna

what the...

Oct 27th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. float integral(float a)
  5. {
  6.     float s;
  7.     if (0 < a <= 1 || a <= 0)
  8.     {
  9.         if (a <= 0)
  10.         {
  11.             s = 0;
  12.         }
  13.         if(a>0 && a<=1)
  14.         {
  15.             s = a;
  16.         }
  17.     }
  18.     else
  19.     {
  20.         s = pow(a, 3);
  21.     }
  22.     return s;
  23. }
  24.  
  25. int main()
  26. {
  27.     float a, s;
  28.     cout << "a= "; cin >> a;
  29.     s = integral(a);
  30.     cout<<"∫(a) = " << s <<"\n";
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment