UPC/1sem/adaptation courses/03/9.cpp
2019-11-18 11:02:11 +07:00

20 lines
No EOL
371 B
C++

// ac_3_9.cpp
// Горбацевич Андрей
#include <iostream>
#include <clocale>
#include <cmath>
using namespace std;
bool in_D(double x, double y)
{
return ((y >= abs(x)) && (x*x+y*y <= 1));
}
int main()
{
double x, y;
cout << "x, y >>>";
cin >> x >> y;
double z = (in_D(x, y)? sin(x) : x + 2 * y );
cout << "z(x,y)= " << z << endl;
}