MegaRak64

6_18

Oct 18th, 2020
477
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     float t = 1;
  10.     float a = 10;
  11.     float c = 5;
  12.     cout << "a = " << a << endl;
  13.     cout << "c = " << c << endl;
  14.     cout << "***************" << endl
  15.          << "* t *    y    *" << endl
  16.          << "***************" << endl;
  17.     do
  18.     {
  19.         float y;
  20.         if(t > 4)
  21.             y = log(t + c);
  22.         if(t == 4)
  23.             y = a * a * a;
  24.         if(t < 4)
  25.             y = pow(sin(sqrt(abs(a * t))), 2);
  26.         cout << '*' << setw(3) << setprecision(1) << t << '*'
  27.              << setw(9) << setprecision(4) << fixed << y << '*' << endl;
  28.         t += 0.5f;
  29.     } while(t <= 8);
  30.     cout << "***************" << endl;
  31. }
  32.  
RAW Paste Data