-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandomMatrisCreate.cs
More file actions
32 lines (29 loc) · 961 Bytes
/
randomMatrisCreate.cs
File metadata and controls
32 lines (29 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RandomMatrisCreate
{
class Program
{
static void Main(string[] args)
{
int n, m;
Console.Write("Rastgele olusturulacak matrisin satir sayisini griniz :"); n = Convert.ToInt32(Console.ReadLine());
Console.Write("Rastgele olusturulacak matrisin sutun sayisini giriniz :"); m = Convert.ToInt32(Console.ReadLine());
int[,] arr = new int[m,n];
Random rnd = new Random();
for (int i = 0; i < m ; i++)
{
Console.Write("| ");
for (int j = 0; j < n; j++)
{
arr[i, j] = rnd.Next(10, 100);
Console.Write(arr[i,j]+" ");
}
Console.WriteLine("|");
}
}
}
}