SHARE
TWEET

Untitled

a guest Jan 20th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for (int i = 0; i < x; i++)
  2. {
  3.     for (int j = 0; j < y; j++)
  4.     {
  5.         Console.Write("mas[" + i + "," + j + "]: ");
  6.         mas[i, j] = int.Parse(Console.ReadLine());
  7.     }
  8. }
  9. Console.WriteLine();
  10.    
  11. using System;
  12. using System.Linq;
  13.  
  14. int[,] array = new int[x, y];
  15. Console.Write("Enter the matrix in one line: ")
  16. int[] numbers = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
  17. for (int i = 0; i < x; i++)
  18.     for (int j = 0; j < y; j++)
  19.         array[i, j] = numbers[i * x + j];
  20.    
  21. using System;
  22. using System.Linq;
  23.  
  24. int[,] array = new int[x, y];
  25. for (int i = 0; i < x; i++)
  26. {
  27.     Console.Write("Enter the line (i = {0}): ", i);
  28.     int[] numbers = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
  29.     for (int j = 0; j < y; j++)
  30.         array[i, j] = numbers[j];
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top