Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <cmath>
- #include <cstdlib>
- #define PI 3.14159265
- using namespace std;
- int main()
- {
- /*
- 3. Obliczenia wartości funkcji:
- x2 + y - 1 dla x > y
- F = sin(y) + 2 dla x == y
- cos(x) - y + 2 dla x < y
- Dane: x, y typu double
- */
- //result = sin (param*PI/180); z neta
- double x,y, F;
- cin>>x>>y;
- if(x>y)
- {
- F = x*x + y - 1 ;
- }
- if(x==y)
- {
- F = sin (y*PI/180);
- }
- if(x<y)
- {
- F = cos (x*PI/180) - y +2;
- }
- cout<<"liczba F to: "<<F;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment