1

Тема: Використання функції

Задані дійсні числа s, t. Отримати
h(s, t) + max( h4 (s − t), s ⋅ t), h4 (s − t, s + t)) + h(1,1) ,
де
https://replace.org.ua/misc.php?action=pun_attachment&item=39

Post's attachments

Снимок.PNG 2.34 kb, 256 downloads since 2012-11-05 

2

Re: Використання функції

Типу так:

#include <stdio.h>
#include <math.h>
double h(double a, double b);
double max(double a,double b);
int main()
{
    double s, t, res;
    printf("Input s: \n");
    scanf("%lf", &s);
    printf("Input t: \n");
    scanf("%lf", &t);
    return printf("%10.3f\n",h(s,t) + max(pow(h(s-t,s*t),4),pow(h(s-t,s+t),4))+h(1,1));
}

double h(double a, double b)
{
    return (a / (1 + pow(b,2))) + (b / (1 + pow(a,2))) - (pow(a,3)-3*pow(a,2)*b+3*a*pow(b,2)-pow(b,3));
}
double max(double a, double b)
{
    double res;
    if(a > b) res = a; 
    else res = b;
    return res;
}
Подякували: Eldar1