malixds_

homework_2.2

Sep 12th, 2021 (edited)
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>;
  2. #include <math.h>;
  3.  
  4. using namespace std;
  5. int main () {
  6.     float a;
  7.         float x;
  8.         cout << "Vvedita a" << '\n';
  9.         cout << "Vvedite x" << '\n';
  10.         cin >> a;
  11.         cin >> x;
  12.         if (abs(x) < 1) {
  13.             float w = a * log(x);
  14.                 cout << w;
  15.         }
  16.  
  17.         if (abs(x) >= 1) {
  18.             if (sqrt(a - pow(x, 2)) >= 0) {
  19.                 float w;
  20.                 w = sqrt(a - pow(x, 2));
  21.                 cout << w;
  22.             }
  23.  
  24.             else
  25.                 cout << "Povtorite popitku";
  26.         }
  27.  
  28.  
  29.  
  30.  
  31. }
Add Comment
Please, Sign In to add comment