- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
int min = 32000;
int max = 0;
int mind = 0;
int i;
int j;
double t;
double f;
int p = 0;
double[] x = new double[4];
double[] k = new double[4]; //массив для К
double[,] s = { { 2, 4, 5, 1, 0, 0, 0 }, { 1, 8, 6, 0, 1, 0, 0 }, { 7, 4, 5, 0, 0, 1, 0 }, { 4, 6, 7, 0, 0, 0, 1 } };
double[,] a = { { 2, 4, 5, 1, 0, 0, 0 }, { 1, 8, 6, 0, 1, 0, 0 }, { 7, 4, 5, 0, 0, 1, 0 }, { 4, 6, 7, 0, 0, 0, 1 } };
double[] b = { 120, 280, 240, 360 };
double[] c = { 10, 14, 12, 0, 0, 0, 0 };
double[] r = new double[7];
double[,] s1 = new double[4, 7];
for ( i = 0; i < 4; i++)
{
for (j = 0; j < 7; j++)
Console.Write(a[i, j] + "\t");
Console.WriteLine("\n");
}
for (j = 0; j < 4; j++)
Console.Write(b[j] + "\t");
Console.WriteLine();
for (j = 0; j < 7; j++)
Console.Write(c[j] + "\t");
Console.WriteLine();
Console.WriteLine();
//первая итерация
for (i = 0; i < 4; i++)
{
for (j = 0; j < 7; j++)
{
if (a[i, j] != 0)
s[i, j] = b[i] / a[i, j];
Console.Write(s[i, j] + "\t");
}
Console.WriteLine();
}
for (j = 0; j < 7; j++)
{
for (i = 0; i < 4; i++)
{
if (s[i, j] < min)
min = Convert.ToInt32(s[i, j]);
}
r[j] = min * c[j];
Console.Write(r[j] + "\t");
}
Console.WriteLine();
for (j = 0; j < 7; j++)
{
if (r[j] > max)
{
max = Convert.ToInt32(r[j]);
p = j;
}
}
for (i = 0; i < 4; i++)
{
for (j = 0; j < 7; j++)
{
k[i] = a[i, p];
}
}
min = 32000;
for (i = 0; i < 4; i++)
{
if (s[i, p] < min)
{
min = Convert.ToInt32(s[i, p]);
mind = i;
}
Console.WriteLine();
}
t = a[mind, p];
for (i = 0; i < 4; i++)
{
for (j = 0; j < 7; j++)
{
s[i, j] = a[i, j];
}
}