Скачиваний:
8
Добавлен:
12.01.2019
Размер:
862 б
Скачать
#include <iostream>
#include <math.h>
#include <iomanip>

using namespace std;

int main()

{
	double x, y, z, S, P, Zmin, Zmax;

	cout.precision(5);
	cout << setw(10) << "x=" << "\t" << setw(10) << "y=" << "\t" << setw(10) << "z=" << endl;
	P = 1;
	S = 0;
	Zmin = 99999;
	Zmax = -99999;
	for (x = 0; x <= 1.2; x += 0.7)
	{
		for (y = 2; y <= 7.8; y += 4.3)
		{
			if (x*y <= 1)
				z = x*pow(sin(y),2);
			else
			{
				if (x*y >= 5)
					z = log(2*(x+y));
				else
					z = 1./(tan(exp(x)));
			}
			cout << setw(10) << x << "\t" << setw(10) << y << "\t" << setw(10) << z << endl;
			S = S + z;
			P = P*z;
			if (Zmax < z)
				Zmax = z;
			if (Zmin > z)
				Zmin = z;
		}
	}
	cout << "S " << S << endl;
	cout << "P " << P << endl;
	cout << "Zmin= " << Zmin << endl;
	cout << "Zmax= " << Zmax << endl;

	return 0;
}
Соседние файлы в папке лаба2 В14