Advertisement
Guest User

Untitled

a guest
Oct 8th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.03 KB | None | 0 0
  1. #include "stdio.h"
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int x, y;
  9.     cin >> x;
  10.     cin >> y;
  11.  
  12.     int a, b, c;
  13.  
  14.     bool bError = false;
  15.  
  16.     // - a
  17.     if(x != 0)
  18.     {
  19.         a = tan((y-x)/x);
  20.         if(a > 0)
  21.         {
  22.             a = sqrt(a);
  23.         }
  24.         else
  25.         {
  26.             bError = true;
  27.         }
  28.     }
  29.     else
  30.     {
  31.         bError = true;
  32.     }
  33.  
  34.     // - b
  35.     if(x != 0)
  36.     {
  37.         b = y*y/x;
  38.         if(b > 0)
  39.         {
  40.             b = ln(b);
  41.         }
  42.         else
  43.         {
  44.             bError = true;
  45.         }
  46.     }
  47.     else
  48.     {
  49.         bError = true;
  50.     }
  51.  
  52.     // - c
  53.     c = y + 2.5f;
  54.     if(c != 0)
  55.     {
  56.         c = arctan(c);
  57.     }
  58.     else
  59.     {
  60.         bError = true;
  61.     }
  62.  
  63.     if(!bError)
  64.     {
  65.         int min = a;
  66.         if(b < min)
  67.             min = b;
  68.  
  69.         if(c < min)
  70.             min = c;
  71.  
  72.         cout << min;
  73.     }
  74.     else
  75.     {
  76.     cout << "Ошибка ввода!\n";
  77.     }
  78.    
  79.     return 0;
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement