From 8b517d136f9c36dd3facfa432cc74ed91d3618dd Mon Sep 17 00:00:00 2001 From: idkWhatUserNameToUse Date: Fri, 31 Mar 2023 21:10:47 +0300 Subject: [PATCH] lab2 with error --- Lab2/Program.cs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Lab2/Program.cs diff --git a/Lab2/Program.cs b/Lab2/Program.cs new file mode 100644 index 0000000..07b376b --- /dev/null +++ b/Lab2/Program.cs @@ -0,0 +1,32 @@ +using System; + +public class Laba2 +{ + + + public static void Main(string[] args) + { + const int a = 2; + int[][] b = new[] + { + new int[] { 1, 2, 8 }, + new int[] { 3, 4, 5 }, + new int[] { 6, 7, 9 } + }; + calculation(b, a); + } + + private static int[][] calculation(int[][] b, int a) + { + int[][]c = new int[b.Length][b[0].Length]; + for (int i = 0; i < b.Length; i++) + { + c[i] = new int[b[i].Length]; + for (int j = 0; j < b[i].Length; j++) + { + c[i][j] = b[i][j] * a; + } + } + return c; + } +} \ No newline at end of file