Advertisement
BojidarDosev

zadacha 2

Feb 23rd, 2020
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.28 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp20
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int i, j;
  14.             int[,] array = new int[4, 4];
  15.             for (i = 0; i < 4; i++)
  16.                 for (j = 0; j < 4; j++)
  17.                     array[i, j] = int.Parse(Console.ReadLine());
  18.             Console.WriteLine("otricatelni: ");
  19.             for (i = 0; i < 4; i++)
  20.             {
  21.                 for(j = 0; j < 4; j++)
  22.                 {
  23.                     if (array[i, j] < 0)
  24.                         Console.Write(array[i, j] + " ");
  25.                 }
  26.             }
  27.             Console.WriteLine("samo 0 : ");
  28.             for ( i = 0; i<4; i++)
  29.                 for(j = 0; j <4; j++)
  30.                 {
  31.                     if (array[i, j] == 0)
  32.                         Console.Write(array[i, j] + " ");
  33.                 }
  34.             Console.WriteLine("samo polojitelni: ");
  35.             for (i = 0; i < 4; i++)
  36.             {
  37.                 for (j = 0; j < 4; j++)
  38.                 {
  39.                     if (array[i, j] > 0)
  40.                         Console.Write(array[i, j] + " ");
  41.                 }
  42.             }
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement