Как мне объявить массив ? - C#
Формулировка задачи:
Как объявить массив от переменной hi.a[2,2]{23,23};Тип того ток двумерный?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ЯЯЯ
{
class Program
{
public int[,] a;
public int[,] b;
public int[,] c;
public Program()
{
for (int i = 0; i < a.GetLength(0); i++)
{
for (int j = 0; j < a.GetLength(1); j++)
{
c[i, j] = a[i, j] + b[i, j];
Console.WriteLine(c[i, j] + " ");
}
Console.WriteLine();
}
}
static void Main(string[] args)
{
Program hi = new Program();
hi.a
}Решение задачи: «Как мне объявить массив ?»
textual
Листинг программы
public static int[,] a = new int[ 2, 2 ] {
{ 23, 23 },
{ 23, 23 }
};