Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: C#  |  size: 0.83 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication69
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             int[,] mat = new int[6,6];
  13.             bool equal = true;
  14.             int emzaS = mat.GetLength(0)/2;
  15.             int emzaT = mat.GetLength(1)/2;
  16.             for (int shura = 0; shura < emzaS; shura++)
  17.                 for (int tur = 0; tur < emzaT; tur++)
  18.                     if ((mat[shura, tur] != mat[emzaS + shura, tur]) || (mat[shura, tur] != mat[shura, emzaT + tur]) || (mat[shura, tur] != mat[emzaS + shura, emzaT + tur]))
  19.                         equal = false;
  20.             if (equal)
  21.                 Console.WriteLine("Equal");
  22.             else
  23.                 Console.WriteLine("Not equal");
  24.         }
  25.     }
  26. }