Advertisement
Guest User

Untitled

a guest
May 2nd, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.97 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 ConsoleApplication3
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int x = 4;
  14.             int y = 4;
  15.  
  16.             int[,] matice = new int[x, y];
  17.  
  18.             matice[1, 1] = 3;
  19.             matice[1, 2] = 6;
  20.             matice[1, 3] = 6;
  21.             matice[2, 1] = 3;
  22.             matice[2, 2] = 3;
  23.             matice[2, 3] = 3;
  24.             matice[3, 1] = 12;
  25.             matice[3, 2] = 6;
  26.             matice[3, 3] = 6;
  27.             int n = 3;
  28.            
  29.            
  30.             for (int i=1; i <=3; i++)
  31.             {
  32.                 for (int j=1; j<=3; j++)
  33.                 {
  34.                     Console.Write(matice[i,j]);
  35.                 }
  36.                 Console.WriteLine();
  37.             }
  38.  
  39.             for (int j = 1; j <= 3;j++ )
  40.             {
  41.                 int pom = matice[j, j];          
  42.                if (! ((matice[j, j] == 1) || (matice[j, j] == 0)))
  43.                 {
  44.                     for (int i = 1; i <= 3;i++ )
  45.                     {
  46.                         matice[j, i] = matice[j, i] / pom;
  47.                     }
  48.                    
  49.                 } else
  50.                {
  51.                    if (matice [j,j] == 0)
  52.                    {
  53.                        for (int i = j+1; i<=3;i++)
  54.                        {
  55.                             if (!(matice [j,i]==0))
  56.                             {
  57.                                
  58.                             }
  59.                        }
  60.                    }
  61.                }
  62.              
  63.             }
  64.  
  65.             for (int i = 1; i <= 3; i++)
  66.             {
  67.                 for (int j = 1; j <= 3; j++)
  68.                 {
  69.                     Console.Write(matice[i, j]);
  70.                 }
  71.                 Console.WriteLine();
  72.             }
  73.  
  74.  
  75.  
  76.                 Console.ReadKey();
  77.         }
  78.     }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement