/*
Veidoja: Viviāna
Grupa: 110
Praktiskais darbs 5
Izmantotais Compiler: www.onlinegdb.com
*/
using System;

class Program
{
  static void Main()
  {
    Console.WriteLine("1.uzd.");
    int [,] skaitl =
    {
        { 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(skaitl[i, j] + " ");
        }
    }
    Console.WriteLine();
    Console.WriteLine("2.uzd.");
    int[][] zade = 
    {
     new int[]{ 9, 2, 8, 9, 4 },
     new int[]{ 33, 34, 76 },
     new int[]{ 22, 11 }
    };
    for ( int i = 0; i < zade.Length; i++)
    {
        for ( int j = 0; j < zade[i].Length; j++)
        {
            Console.Write(zade[i][j] + " ");
    }
    }
    Console.WriteLine();
   Console.WriteLine("3.uzd.");
    
    for (int i = 0; i < 3; i++)
    {
        int summa = 0;
        for (int j = 0; j < 4; j++)
        {
            summa += skaitl[i, j];
        }
        Console.WriteLine("Rindas summa: " + summa);
    }
    Console.WriteLine("4.uzd.");
    
    int[][] robotais = 
    {
     new int[]{ 9, 67, 8, 6, 4 },
     new int[]{ 73, 24, 66 },
     new int[]{ 22, 112 }
    };
    
    Console.Write("Ievadi skaitli: ");
        int skaitlis = int.Parse(Console.ReadLine());

        bool atrasts = false;

        for (int i = 0; i < robotais.Length; i++)
        {
            for (int j = 0; j < robotais[i].Length; j++)
            {
                if (robotais[i][j] == skaitlis)
                {
                    Console.WriteLine("Rindā " + i + ", kolonnā " + j);
                    atrasts = true;
                }
            }
        }

        if (!atrasts)
        {
            Console.WriteLine("Skaitlis nav atrasts masīvā.");
        }
   }    
}