Guest User

Untitled

a guest
Feb 22nd, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <cmath>
  4. #include <cstdlib>
  5.  #define PI 3.14159265
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     /*
  12.     3.  Obliczenia wartości funkcji:
  13.  
  14.         x2 + y - 1      dla x > y
  15.  
  16. F =     sin(y) + 2      dla x == y
  17.  
  18.         cos(x) - y + 2      dla x < y
  19.  
  20. Dane: x, y  typu double
  21.  
  22.     */
  23.     //result = sin (param*PI/180); z neta
  24.  
  25. double x,y, F;
  26. cin>>x>>y;
  27.  
  28. if(x>y)
  29. {
  30.     F = x*x + y - 1 ;
  31. }
  32.  
  33. if(x==y)
  34. {
  35.     F = sin (y*PI/180);
  36.    
  37. }
  38.  
  39. if(x<y)
  40. {
  41.     F = cos (x*PI/180) - y +2;
  42.    
  43. }
  44.  
  45. cout<<"liczba F  to: "<<F;
  46.     return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment