Advertisement
Guest User

Untitled

a guest
Sep 28th, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. int main()
  5. {
  6.     float q = 0.0f;
  7.     float x = 0.0f;
  8.     float z = 0.0f;
  9.     float res = 0.0f;
  10.    
  11.     std::cout << "Enter x: ";
  12.     std::cin >> x;
  13.     std::cout << "Enter z: ";
  14.     std::cin >> z;
  15.     std::cout << "Enter q: ";
  16.     std::cin >> q;
  17.    
  18.     if(x > q)
  19.     {
  20.         res = log2f(x + 2.0f);
  21.     }
  22.     else
  23.     {
  24.         res = 3.14f / 2.0f * ((cosf(z)*cosf(z)*cosf(z)));  
  25.     }
  26.     std::cout << "res: " << res << std::endl;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement