Advertisement
o91leg

Untitled

Mar 20th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 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 _2_Сshrp_L
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int col = 0;
  14. int line = 1;
  15. int[,] array = {
  16. { 6, 2, 89, 4, 3, 9 },
  17. { 5, 5, 3, 2, 6, 2 },
  18. { 6, 6, 9, 1, 4, 2 } };
  19.  
  20. for (int i = 0; i < array.GetLength(0); i++)
  21. {
  22. for (int j = 0; j < array.GetLength(1); j++)
  23. {
  24. Console.Write(array[i, j] + " ");
  25. }
  26. Console.WriteLine();
  27. }
  28. int sum = 0, multi = 1;
  29.  
  30. for (int i = 0; i < array.GetLength(0); i++)
  31. {
  32. multi*= array[i, col];
  33. }
  34. for (int i = 0; i < array.GetLength(1); i++)
  35. {
  36. sum += array[line, i];
  37. }
  38. Console.WriteLine("Произведение 1ого столбца : " + multi);
  39. Console.WriteLine("Сумма 2й строки : " + sum);
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement