Advertisement
Werjil

Untitled

Dec 6th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. class Program
  2. {
  3. static void Main(string[] args)
  4. {
  5. int[,] array = new int[5, 5];
  6. Random ran = new Random();
  7. int sumLine = 0;
  8. int tableColumn = 1;
  9. for (int i = 0; i < array.GetLength(0); i++)
  10. {
  11. for (int j = 0; j < array.GetLength(1); j++)
  12. {
  13.  
  14. array[i, j] = ran.Next(1, 9);
  15. if (i == 1) { sumLine += array[i, j]; }
  16. if (j == 1) { tableColumn *= array[i, j];}
  17. Console.Write(array[i,j] + " ") ;
  18. }
  19. Console.WriteLine("");
  20. }
  21. Console.WriteLine("Сумма второй строки - " + sumLine);
  22. Console.WriteLine("Произведение второго столбца - " + tableColumn);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement