Добавил:
Romchouz
НГТУ. Автоматизация машиностроения.
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:
----------------------------------------------------------------
ЗАДАЧА1
// 1A.cpp: определяет точку входа для консольного приложения.
//
#include "stdafx.h"
#include "math.h"
#include "iostream"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
double x, y, z, g, f1;
system("color F0");
cout <<"input x\n";
cin >> x;
y = cos(x / 7) + ((20 * x) / (x + 3.2)) - pow((1 / (x - 5)),20); cout << "y=" << y << endl;
z = log(fabs(pow(x - 1, 1 / 3.))); cout << "z=" << z << endl;
g = sin(0.96*x*x + (1. / x)); cout << "g=" << g << endl;
if (y > z)
f1 = y;
else
f1 = z;
cout << "f1=" << f1 << endl;
system("pause");
return 0;
}
----------------------------------------------------------------
ЗАДАЧА2
/ 1A.cpp: определяет точку входа для консольного приложения.
//
#include "stdafx.h"
#include "math.h"
#include "iostream"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
double x, y, Z, g, U, f1, f2, f3, f4;
system("color F0");
cout <<"input x\n";
cin >> x;
cout << "input y\n";
cin >> y;
f1 = x*x*x+atan(1.0/(y*y+1.0));
f2 = exp(x/y);
f3 = pow(log(x*x),1.0/2.0);
if (x - y >= 1)
Z = f3;
else
Z = f2;
if (x - y <= -1)
Z = f1;
cout << "Z=" << Z << endl;
system("pause");
return 0;
}
----------------------------------------------------------------
ЗАДАЧА3
// 1A.cpp: определяет точку входа для консольного приложения.
//
#include "stdafx.h"
#include "math.h"
#include "iostream"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
double x, y, z, g, U, f1, f2, f3, f4;
system("color F0");
cout <<"input x\n";
cin >> x;
cout << "input y\n";
cin >> y;
f1 = log(pow(y,2.0))+ (pow((x *y) / 5.0, 3.0))*((3.5*x)/(x+6));
f2 = cos(x);
f3 = sin(x / y);
if (f2 < f3)
f4 = f2;
else
f4 = f3;
if (y < x)
U = f4;
else
U = f1;
cout << "U=" << U << endl;
system("pause");
return 0;
}
----------------------------------------------------------------
Соседние файлы в папке LR1