class Matriz
{ int[,] matriz;
public int this[int i, int j]
{
get
{
return mat[i, j];
}
set {
mat[i, j] = value;}
}
public Matriz(int ren, int col){
matriz = new int[ren, col];
}public int this[int ren, int col]
{
get { return matriz[ren, col];
set { matriz[ren, col] = value; }
}
public double PromedioDP() {
double suma =0.0;
for (int e = 0; e < matriz.GetLength(0); e++)
suma += matriz[e, e];
return suma / matriz.GetLength(0);
}
public double PromedioDI()
{
double suma = 0.0; for (int e = 0; e < matriz.GetLength(0); e++)
suma += matriz[e, matriz.GetLength(0) - e - 1]; return suma / matriz.GetLength(0);
}
No hay comentarios:
Publicar un comentario