Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int Stepen(double a) {
  7.     double z = a;
  8.     int b = 3, i;
  9.     for (i = 1; i < b; i++) {
  10.         z *= a;
  11.     }
  12.     return z;
  13. }
  14.  
  15. int main() {
  16.     double j;
  17.     int k, m;
  18.     cout << "Enter k: ";
  19.     cin >> k;
  20.     cout << "Enter m: ";
  21.     cin >> m;
  22.     if (k < m)
  23.         j = sin(5 * k + 3 * m * abs(k));
  24.     else if (k > m)
  25.         j = cos(5 * k + 3 * m * abs(k));
  26.     else
  27.         j = Stepen(k);
  28.    
  29.     cout << "J = " << j;
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement