Open artem05kz opened 1 year ago
void Task8() { double matrix1[3][4] { {5, 2, 0, 10}, {3, 5, 2, 5}, {20, 0, 0, 0} }, matrix2[4][2] { {1.20, 0.50}, {2.80, 0.40}, {5.00, 1.00}, {2.00, 1.50} }, matrix3[3][2], result = 0, maxIncome = 0, minIncome = 100000000, totalIncome = 0, maxComission = 0, minComission = 100000000, totalComission = 0, totalMoney = 0;
for (int i = 0; i < 3; ++i)
{
for (int j = 0; j < 2; ++j)
{
for (int k = 0; k < 4; ++k)
{
result += matrix1[i][k] * matrix2[k][j];
}
matrix3[i][j] = result;
if (j == 0)
{
if (result > maxIncome)
{
maxIncome = result;
}
if (result < minIncome)
{
minIncome = result;
}
totalIncome += result;
}
if (j == 1)
{
if (result > maxComission)
{
maxComission = result;
}
if (result < minComission)
{
minComission = result;
}
totalComission += result;
}
totalMoney += result;
result = 0;
cout << setw(5) << matrix3[i][j] << " ";
}
cout << endl;
}
cout << "max income: " << maxIncome << endl;
cout << "min income: " << minIncome << endl;
cout << "max comission: " << maxComission << endl;
cout << "min comission: " << minComission << endl;
cout << "total income: " << totalIncome << endl;
cout << "total comission: " << totalComission << endl;
cout << "total money: " << totalMoney << endl;
}
include
include
include
include
include
using namespace std;
void File() { cout << "Введите числа" << endl; ofstream F("file.txt"); int numbers[10];
}
double SignX(double x) { if (x > 0) return 1; else if (x == 0) return 0; else if (x < -1) return -1; else return 0; }
double Pramygol(double x) { double a, b; cout << "Введите длину и ширину прямоугольника" << endl; cin >> a >> b; if (a > 0 && b > 0) return x = a * b; else { cout << "Не верные данные"; return 0; } }
double Treyg(double x) { double a, b; cout << "Введите основание и высоту треугольника" << endl; cin >> a >> b; if (a > 0 && b > 0) return x = 0.5 a b; else { cout << "Не верные данные"; return 0; } }
double Kryg(double x) { double a; cout << "Введите радиус круга" << endl; cin >> a; if (a > 0) return x = a a 3.14; else { cout << "Не верные данные"; return 0; } }
void Flag() { for (int i = 1; i <= 13; i++) { for (int j = 0; j < 60; j++) { if (i < 5 && j < 13) { cout << "*"; } else cout << "_"; } cout << endl; } }
//void Sin() //{ // HWND hWnd = GetConsoleWindow(); // HDC hDC = GetDC(hWnd); // HPEN Pen = CreatePen(PS_SOLID, 2, RGB(255, 255, 255)); // SelectObject(hDC, Pen); // MoveToEx(hDC, 0, 85, NULL); // LineTo(hDC, 200, 85); // MoveToEx(hDC, 100, 0, NULL); // LineTo(hDC, 100, 170); // for (float x = -8.0f; x <= 8.0f; x += 0.01f) // { // MoveToEx(hDC, 10 x + 100, -10 sin(x) + 85, NULL); // LineTo(hDC, 10 x + 100, -10 sin(x) + 85); // } // ReleaseDC(hWnd, hDC); // cin.get(); //}
double Rim(double sum = 0) { string y; cout << "Введите римское число" << endl; cin >> y; int i = 0; for (const char c : y) {
}
void Random() { int s{}, m{}, b{}, c{}; cout << "Введите числа m, b и c " << endl; cin >> m >> b >> c;
for (int i = 0; i < 11; i++) { s = (m * s + b) % c; cout << "Рандомное число = " << s << endl;
}
void Matrix() { int tovar[3][4] { {5, 2, 0, 10}, {3, 5, 2, 5}, {20, 0, 0, 0} }; int cena[2][2] {
}
void Sisch() { string chislo, result; int osnova_1, osnova_2; int chislo10Sis = 0; int a, b; cout << "Введите число" << endl; cin >> chislo; cout << "Введите исходнуе систему счисления и новую \n"; cin >> osnova_1 >> osnova_2; int i = chislo.size() - 1;
}
int main() { setlocale(LC_ALL, "Rus"); double x = 0; string y;
cout << "Площадь прямоугольника \t" << Pramygol(x) << endl; // 3 ЗАДАНИЕ
cout << "Площадь треугольника \t" << Treyg(x) << endl;
cout << "Площадь круга \t" << Kryg(x) << endl;
Flag();*/ // 4 ЗАДАНИЕ
/Sin();/ // 5 ЗАДАНИЕ
/cout << "Ваше число \t" << Rim(x) << endl; / // 6 ЗАДАНИЕ
}