_strangeman

lab2

Nov 4th, 2014
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using std::cin;
  5. using std::cout;
  6.  
  7. int main() {
  8.     double y;
  9.     const double hx = 0.1, a = 1.5, b = 2;
  10.     cout << "Solutions of set are:";
  11.     for (double x = 1; x <= 3; x += hx) {
  12.  
  13.         if (x < 2) {
  14.             y = sin(fabs(a*x + pow(b,a)));
  15.         }
  16.         else {
  17.             y = cos(fabs(a*x - pow(b,a)));
  18.             break;
  19.         }
  20.         cout << " " << y << ";";
  21.     }
  22.     cout << "\n";
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment