namespace Mang2ChieuTrongCsharp
{
class Program
{
static void Main(string[] args)
{
//Khai bao mang
int[,] mang=new int[100,100];
int so;
Console.Write("Ban muon nhap ma tran vuong cap may:");
so = int.Parse(Console.ReadLine());
//Nhap gia tri cho mang
for (int i = 0; i < so; i++)//Phan tu dau tien bat dau =0
{
for (int j = 0; j < so; j++)
{
Console.Write("Nhap phan tu dong {0} cot {1}:", i+1,j+1);
mang[i,j] = int.Parse(Console.ReadLine());
}
}
//Xuat gia tri da nhap
Console.WriteLine("Ma tran da nhap la:");
for (int i = 0; i < so; i++)//Phan tu dau tien bat dau =0
{
for (int j = 0; j < so; j++)
{
Console.Write("{0} ",mang[i, j]);
}
Console.WriteLine();
}
Console.ReadLine();
}
}
}
0 comments:
Post a Comment