/*
Veidoja: Toms Trencis
Grupa: 110 
Praktiskais darbs 5
Izmantotais Compiler: https://www.onlinegdb.com/online_csharp_compiler
*/


// 1. uzdevums
/*
using System;

public class HelloWorld
{
public static void Main(string[] args)
{
int[,] numbers = {
{ 1, 2, 3, 4 },
{ 5, 6, 7, 8 },
{ 9, 10, 11, 12 }
};


for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 4; j++)
{
Console.Write(numbers[i, j] + "\t");
}
Console.WriteLine();
}
}
}
*/

// 2. uzdevums

/*
using System;

public class HelloWorld
{
public static void Main(string[] args)
{
int[] [] numbers2 = {
new int [] { 1, 2, 3, },
new int [] { 4, 5 },
new int [] { 6, 7, 8, 9 }
};

for (int i = 0; i < numbers.Length; i++)
{
Console.Write("Row" + i + ": ");
foreach(int num in numbers[i])
Console.Write(num + " ");

Console.WriteLine();
}
}
}
*/


// 3. uzdevums
/*
using System;

public class HelloWorld
{
public static void Main(string[] args)
{
int [,] numbers3 = {
{ 100, 50, 25, 75, 129},
{ 54, 23, 71, 29, 49},
{ 12, 104, 672, 13, 92},
{ 52, 39, 47, 21, 145},
};

for (int i = 0; i < 4; i++)
{
int summa = 0;
for (int j = 0; j < 5; j++)
{
summa += numbers3[i, j];
}
Console.WriteLine("Rinda " + (i+1) + "summa: " + summa);
}
}
}
*/

// 4. uzdevums
using System;

public class HelloWorld
{
public static void Main(string[] args)
{
int[][] numbers4 = {
new int[] { 1, 2, 3 },
new int[] { 4, 5 },
new int[] { 6, 7, 8, 9 }
};

Console.WriteLine("Ievadiet numuru: ");
int number = int.Parse(Console.ReadLine());
bool atrasts = false;
for (int i = 0; i < numbers4.LEngth; i++)
{
for (int j = 0; j < numbers4[i].Length; j++)
{
if (numbers4[i][j] == number)
{
Console.WriteLine($"Atrasts rinda {i}, atrasts kolonna {j}");
found = true;
}
}
}
if (!atrasts)
{
Console.WriteLine("Numurs nav atrasts.");
}
}
}