Main.cs
using
System;
class
Program {
-
public
static
int
Main() {
-
decimal
[,] ara =
new
decimal
[2, 3] { { 1, 3, 5 }, { 10, 20, 30 } };
-
decimal
avg = 0.0m;
-
for
(
int
i=0; i<2; i++) {
-
for
(
int
j=0; j<3; j++) {
-
avg+=ara[i, j];
-
}
-
}
-
avg/=ara.Length;
-
Console.WriteLine(avg);
-
Console.ReadKey();
-
return
0;
-
}
}
using
System;
class
Program {
-
public
static
int
Main() {
-
decimal
[,] ara =
new
decimal
[2, 3] { { 1, 3, 5 }, { 10, 20, 30 } };
-
decimal
avg = 0.0m;
-
for
(
int
i=0; i<2; i++) {
-
for
(
int
j=0; j<3; j++) {
-
avg+=ara[i, j];
-
}
-
}
-
avg/=ara.Length;
-
Console.WriteLine(avg);
-
Console.ReadKey();
-
return
0;
-
}
}
11,5