/*
Veidoja:Tomass Dučkens
Grupa:110
Praktiskais Darbs 6.2
izmantotais compailer:https://www.programiz.com/online-compiler/2gyrFSAtVuYdf
*/
using System;

namespace MyApplication
{
class Program
{
static void Main(string[] args)
{
int[,] numbers = { {1, 4, 2, 6}, {3, 6, 8, 7},{9, 0, 10, 5} };

for (int i = 0; i < numbers.GetLength(0); i++)
{
for (int j = 0; j < numbers.GetLength(1); j++)
{
Console.Write(numbers[i, j]);


}
Console.WriteLine();
}
Console.WriteLine();

int[][] robots = new int[3][];

robots[0] = new int[] { 4, 8, 1 };
robots[1] = new int[] { 3, 9 };
robots[2] = new int[] { 6, 7, 5, 2 };

for(int r = 0; r < robots.Length; r++)
{
foreach (int num in robots[r])
Console.Write(num + " ");

Console.WriteLine();

}
Console.WriteLine();
int[,] SUM = { { 2, 4, 6, 8, 10}, {12, 14, 16, 18, 20}, {22, 24, 26, 28, 30},{32, 34, 36, 38, 40}};

int rind = SUM.GetLength(0);
int kol = SUM.GetLength(1);

for (int r = 0; r < rind; r++)
{
int rindassumma = 0;
for (int p = 0;p < kol; p++)
{
rindassumma += SUM [r, p];

}
Console.WriteLine($"{r + 1}. rindas summa: {rindassumma}");
}
Console.WriteLine();
int[][] robots2 + new int [3][];
robots2[0] = new int [] {3, 6, 9, 12};
robots2[0] = new int [] {15, 18, 21};
robots2[0] = new int [] {24, 27, 30, 33, 36};

Console.WriteLine("Ievadiet skaitli, kuru mekles: ");
int sk = int.Parse(Console.ReadlLine());

bool atrasts = false;

for (int r = 0; r < robots2.Length; r++)
{
for (int p = 0; p < robots2.Length; p++)
{
if (robots2[r][p] == sk)
{
Console.WriteLine($"sk {sk} atrasts {r+1}. rinda. {p+1}. kolona.");

atrasts = true;

}
}
}
if(!atrasts)
{
Console.WriteLine($"sk {sk} masiva netika atrasts.");
}
Console.WriteLine();

robots2[0] = new int [] {4, 8, 12, 16};
robots2[0] = new int [] {20, 24, 28};
robots2[0] = new int [] {32, 36, 40, 44, 48};

for (int r = 0; r < robots3.Length; r++);
{
Array.Sort(robots3[r]);
}
for (int r = 0; r < Console.Length; p++);
{
Console.Write($"{r+1}. rinda: ");
for (int p = 0; p < Console.Length p++);
{
Console.Write(robots3[r][p] + "");
}
Console.WriteLine();
}
Console.WriteLine();
}
}
}