E26 Ex7
This commit is contained in:
parent
098cd0697f
commit
d0abfe9bdb
@ -53,8 +53,21 @@ namespace Exercises_C_Sharp.E26_Mehrdimensionale_Arrays
|
||||
static Tuple<double[], double, double> WorkArray(double[,] dArray)
|
||||
{
|
||||
//Code START
|
||||
dynamic d = -1;
|
||||
return d;
|
||||
List<double> rows = [];
|
||||
double allSum = 0;
|
||||
|
||||
for (int i = 0; i < dArray.GetLength(0); i++)
|
||||
{
|
||||
double sum = 0;
|
||||
for (int j = 0; j < dArray.GetLength(1); j++)
|
||||
{
|
||||
sum += dArray[i, j];
|
||||
allSum += dArray[i, j];
|
||||
}
|
||||
rows.Add(sum / dArray.GetLength(1));
|
||||
}
|
||||
|
||||
return new(rows.ToArray(), rows.Average(), allSum / dArray.Length);
|
||||
//Code ENDE
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user