Задача №1 лабораторная №1:
ТЕКСТ ПРОГРАММЫ:
#include "stdafx.h"
#include <iostream>
#include <math.h>
using namespace std;
void main()
{
setlocale(LC_ALL, "Russian");
double x, a, Y, Z, U;
cout << "Введите x,a\n";
cin >> x >> a;
cout << "исходные данные\n";
cout << "x=" << x << "\t a=" << a << endl;
Y = cos(x) + pow(a, 2);
Z = log(x + cos(a));
cout << "результат\n";
cout << "Y=" << Y << "\t Z" << Z << endl;
if (Y > Z) U = Y;
else U = Z;
cout << "U=" << U;
}
РЕЗУЛЬТАТ:
Задача №2 лабораторная №1:
ТЕКСТ ПРОГРАММЫ:
#include "stdafx.h"
#include <iostream>
#include <math.h>
using namespace std;
void main()
{
setlocale (LC_ALL, "Russian");
double x, y, U;
cout << "Введите x,y\n";
cin >> x >> y;
cout << "Исходные данные\n";
cout << "x=" << x << "\t y=" << y << endl;
if (pow(x, 2)*y <= -1) U = cos(x + y) + x;
else
{
if (pow(x, 2)*y < 5) U = pow(x, 2) + log(x + pow(y, 3));
else U = sin(fabs(y));
}
cout << "Результат\n";
cout << "U=" << U;
}
РЕЗУЛЬТАТ 1:
РЕЗУЛЬТАТ 2:
РЕЗУЛЬТАТ 3: