Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.27 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 ConsoleApp16
  8. {
  9.     class Program
  10.     {
  11.  
  12.         static void Main(string[] args)
  13.         {
  14.             bool[,] tab = new bool[5, 8];
  15.             int zap = 0;
  16.  
  17.  
  18.             for (int i = 0; i < 5; i++)
  19.  
  20.             {
  21.                 for (int j = 0; j < 8; j++)
  22.                 {
  23.                     if ((i % 2 == 0))
  24.                     {
  25.                         if (j % 2 == 0)
  26.                         {
  27.  
  28.                             tab[i, j] = true;
  29.                         }
  30.                     }
  31.                     else
  32.                     {
  33.                         tab[i, j] = false;
  34.                     }
  35.  
  36.                 }
  37.             }
  38.             int licznik = 0;
  39.  
  40.             for (int i = 0; i < 5; i++)
  41.             {
  42.                 for (int j = 0; j < 8; j++)
  43.                 {
  44.                     Console.WriteLine("Tab[{0},{1}] = {2}", i, j, tab[i, j]);
  45.                 }
  46.             }
  47.  
  48.  
  49.  
  50.  
  51.             //foreach (bool x in tab)
  52.             //{
  53.             //    Console.WriteLine("{0}  {1} ",licznik, x);
  54.             //    licznik++;
  55.             //}
  56.             Console.ReadKey();
  57.  
  58.  
  59.         }
  60.  
  61.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement