Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace MatrizViseVersa
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Console.OutputEncoding = Encoding.UTF8;
- int minValue = 1;
- int maxValue = 10;
- int rowIndex = 0;
- int columnNumber = 1;
- int sumResult = 0;
- int multiplyResult = 1;
- int [,] numbers = new int[3, 3];
- Random random = new Random();
- for (int i = 0; i < numbers.GetLength(0); i++)
- {
- for (int j = 0; j < numbers.GetLength(1); j++)
- {
- numbers[i, j] = random.Next(minValue, maxValue);
- Console.Write(numbers[i, j] + " ");
- }
- Console.WriteLine();
- }
- for (int i = 0; i < numbers.GetLength(0); i++)
- {
- multiplyResult *= numbers[rowIndex, i];
- }
- Console.WriteLine($"Произведение первого столбца: {multiplyResult} ");
- for (int j = 0; j < numbers.GetLength(1); j++)
- {
- sumResult += numbers[columnNumber, j];
- }
- Console.WriteLine($"Cумму второй строки: {sumResult} ");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment