C/C++

Пожалуйста, помогите написать программу на С++

 #include  
#include
#include
using namespace std;
double min(const double a, const double b, const double c) {
return (a < b) ? (a < c) ? a : c : (b < c) ? b : c;
}
double max(const double a, const double b, const double c) {
return (a > b) ? (a > c) ? a : c : (b > c) ? b : c;
}
double input(const char* msg) {
cout > value;
cin.ignore(numeric_limits::max(), '\n');
return value;
}
int main() {
const auto two = 2.0;
const auto sin2 = sin(two);
const auto a = input("a: ");
const auto b = input("b: ");
const auto c = input("c: ");
const auto mn = min(a, b, c);
if (!mn) puts("Error: division by zero!");
else {
const auto mx = max(a, b, c);
const auto arg = sin2 + mx / mn;
const auto eps = 1e-15;
if (fabs(arg) < eps) puts("Error: division by zero!");
else {
const auto s = (mx - two * mn) / arg;
cout.setf(ios::fixed);
cout.precision(15);
cout
Денис Яцько
Денис Яцько
52 752
Лучший ответ
#include <iostream>
#include <cmath>
#include <cstdlib>

using namespace std;

double max(double x, double y, double z)
{
double r;
if(x >= y)
{
if(x >= z) r = x;
r = z;
}
else // if(x < y)
{
if(y >= z) r = y;
else r = z;
}

return r;
}

double min(double x, double y, double z)
{
double r;
if(x <= y)
{
if(x <= z) r = x;
else r = z;
}
else // if(x > y)
{
if(y <= z) r = y;
else r = z;
}

if(r == 0.0)
{
// чтобы не делить на ноль
cerr << "Error" << endl;
exit(1);
}

return r;
}

int main()
{
double x,y,z,s;
cin >> x >> y >> z;
s = ( max(x,y,z) - 2 * min(x,y,z) ) / ( sin(2.0) + max(x,y,z) / min(x,y,z) );
cout << s << endl;

return 0;
}
KJ
Kaz Judo Team
94 519
Владимир Фигуровский Благодарю тебя <3
9 класс задачка для простачков