Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace SzTFLabor04
- {
- class Program
- {
- static void Matrix_Ki(ref int[,] mat)
- {
- for (int j = 0; j < 2; j++)
- {
- Console.Write("|");
- for (int i = 0; i < 2; i++)
- {
- Console.Write(mat[j,i]);
- if (i == 0)
- {
- Console.Write(" ");
- }
- }
- Console.WriteLine("|");
- }
- }
- static int detM(ref int[,] mat)
- {
- return mat[0, 0] * mat[1, 1] - mat[0,1]*mat[1,0];
- }
- static void Main(string[] args)
- {
- Console.ForegroundColor = ConsoleColor.Black;
- Console.BackgroundColor = ConsoleColor.White;
- Console.Title = "SzTFLabor";
- Console.Clear();
- int[,] M = new int[2,2];
- for (int i = 0; i < 4; i++)
- {
- Console.Write($"{i}. elem: ");
- int a = int.Parse(Console.ReadLine());
- M[i / 2,i % 2] = a;
- }
- Matrix_Ki(ref M);
- Console.Write(detM(ref M));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement