1.uzdevums
/*
  Veidoja: Dimitrijs Mihailovskis
  Grupa: 110
  Praktiskais darbs 6.2
  Izmantotais Compiler: Visual Studio 2026
*/
using System;
class Program
{
    static void Main()
    {
        int[,] masivs = {
            { 4,  6,  8,  0 },
            { 15,  19,  23,  12 },
            { 29, 11, 45, 67 }
        };
        for (int i = 0; i < masivs.GetLength(0); i++)
        {
            for (int j = 0; j < masivs.GetLength(1); j++)
            {
                Console.Write(masivs[i, j] + "\t");
            }
            Console.WriteLine();
        }
    }
}
2.uzdevums
/*
  Veidoja: Dimitrijs Mihailovskis
  Grupa: 110
  Praktiskais darbs 6.2
*/
using System;
class Program
{
    static void Main()
    {
        int[][] masivs = new int[3][];
        masivs[0] = new int[] { 12, 25 }; 
        masivs[1] = new int[] { 34, 44, 53 };
        masivs[2] = new int[] { 66 };
        for (int i = 0; i < masivs.Length; i++)
        {
            for (int j = 0; j < masivs[i].Length; j++)
            {
                Console.Write(masivs[i][j] + "\t");
            }
            Console.WriteLine();
        }
    }
}


3.uzdevums
/*
  Veidoja: Dimitrijs Mihailovskis
  Grupa: 110
  Praktiskais darbs 6.2
*/
using System;
class Program
{
    static void Main()
    {
        int[,] masivs = {
            { 3, 7, 1, 4, 9 },
            { 2, 6, 8, 5, 0 },
            { 4, 4, 4, 4, 4 },
            { 9, 1, 3, 2, 6 }
        };
        for (int i = 0; i < masivs.GetLength(0); i++)
        {
            int summa = 0;
            for (int j = 0; j < masivs.GetLength(1); j++)
            {
                summa += masivs[i, j];
            }
            Console.WriteLine($"{i + 1}. rinda summa: {summa}");
        }
    }
}
4.uzdevums
/*
  Veidoja: Dimitrijs Mihailovskis
  Grupa: 110
  Praktiskais darbs 6.2
*/
using System;
class Program
{
    static void Main()
    {
        int[][] roboti = new int[3][];
        roboti[0] = new int[] { 5, 12, 7 };
        roboti[1] = new int[] { 3, 8, 9 };
        roboti[2] = new int[] { 6, 1, 4 };
        Console.Write("Ievadi skaitli, ko meklēt: ");
        int meklētais = int.Parse(Console.ReadLine());
        bool atrasts = false;
        for (int i = 0; i < roboti.Length; i++)
        {
            for (int j = 0; j < roboti[i].Length; j++)
            {
                if (roboti[i][j] == meklētais)
                {
                    Console.WriteLine($"Skaitlis {meklētais} atrasts rinda {i}, kolonnā {j}.");
                    atrasts = true;
                }
            }
        }
        if (!atrasts)
        {
            Console.WriteLine("Skaitlis nav atrasts masīvā.");
        }
    }
}
5.uzdevums
/*
  Veidoja: Dimitrijs Mihailovskis
  Grupa: 110
  Praktiskais darbs 6.2
*/
using System;
class Program
{
    static void Main()
    {
        int[][] roboti = new int[3][];
        roboti[0] = new int[] { 91, 89, 11 };
        roboti[1] = new int[] { 72, 18, 39 };
        roboti[2] = new int[] { 66, 8, 42 };
        for (int i = 0; i < roboti.Length; i++)
        {
            Array.Sort(roboti[i]);
        }
        Console.WriteLine("Sakārtots masīvs:");
        for (int i = 0; i < roboti.Length; i++)
        {
            for (int j = 0; j < roboti[i].Length; j++)
            {
                Console.Write(roboti[i][j] + "\t");
            }
            Console.WriteLine();
        }
    }
}

6.uzdevums
/*
  Veidoja: Dimitrijs Mihailovskis
  Grupa: 110
  Praktiskais darbs 6.2
*/
using System;
class Program
{
    static void Main()
    {
        int[,] matrica = {
            { 1, 2, 3, 4, 5 },
            { 6, 7, 8, 9, 10 },
            { 11, 12, 13, 14, 15 }
        };
        int rindas = matrica.GetLength(0);
        int kolonnas = matrica.GetLength(1);
        int[,] transponēta = new int[kolonnas, rindas];
        for (int i = 0; i < rindas; i++)
        {
            for (int j = 0; j < kolonnas; j++)
            {
                transponēta[j, i] = matrica[i, j];
            }
        }
        Console.WriteLine("Oriģinālā matrica:");
        for (int i = 0; i < rindas; i++)
        {
            for (int j = 0; j < kolonnas; j++)
            {
                Console.Write(matrica[i, j] + "\t");
            }
            Console.WriteLine();
        }
        Console.WriteLine("\nTransponētā matrica:");
        for (int i = 0; i < kolonnas; i++)
        {
            for (int j = 0; j < rindas; j++)
            {
                Console.Write(transponēta[i, j] + "\t");
            }
            Console.WriteLine();
        }
    }
}