Advertisement
JuliaPopadowska

zad 2/4 PN

May 27th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include<math.h>
  2.  
  3. int main() {
  4.  
  5.     double a, b,G;
  6.    
  7.     printf_s("Podaj a i b: ");
  8.     scanf_s("%lf %lf", &a, &b);
  9.  
  10.     if (a >= 0)
  11.     {
  12.         if (b < 0)
  13.         {
  14.             G = (a*a + log(-b));
  15.         }
  16.         else
  17.         {
  18.             printf_s("Brak rozwiazania!");
  19.             return 0;
  20.         }
  21.     }
  22.     if(b>0)
  23.     {
  24.         G = a - sqrt(b);
  25.     }
  26.     else
  27.     {
  28.         printf_s("Brak rozwiazania!");
  29.         return 0;
  30.     }
  31.     printf_s("%lf", G);
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement