Neon1x1st

3.1

Feb 14th, 2022 (edited)
492
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace CSharpLight
  7. {
  8.  
  9.     public static class Program
  10.     {
  11.         public static void Main()
  12.         {
  13.             int sum = 0;
  14.             int product = 1;
  15.             int[,] numbers = { { 1, 2, 3, 4, 5 }, { 5, 6, 7, 8, 9 } };
  16.  
  17.             for (int i = 0; i < numbers.GetLength(0); i++)
  18.             {
  19.                 for (int j = 0; j < numbers.GetLength(1); j++)
  20.                 {
  21.                     Console.Write(numbers[i, j]);
  22.  
  23.                 }
  24.                 Console.WriteLine();
  25.             }
  26.             for (int i = 0; i < numbers.GetLength(1); i++)
  27.             {
  28.                 sum += numbers[1,i];    
  29.             }
  30.             Console.WriteLine(sum);
  31.             for (int i = 0; i < numbers.GetLength(0); i++)
  32.             {
  33.                 product *= numbers[i, 0];
  34.             }
  35.             Console.WriteLine(product);
  36.  
  37.  
  38.  
  39.         }
  40.     }
  41. }
Add Comment
Please, Sign In to add comment