Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- int resultAddition = 0;
- int resultMultiplication = 0;
- int[,] arrayNumbers = { { 5, 3,2 }, { 5, 3, 2} };
- for (int i = 0; i < arrayNumbers.GetLength(0); i++)
- {
- Console.WriteLine();
- for (int b = 0; b < arrayNumbers.GetLength(1); b++)
- {
- Console.Write(arrayNumbers[i, b] + " ");
- resultAddition += arrayNumbers[1, b];
- for (int j = 1; j < arrayNumbers.GetLength(0); j++)
- {
- resultMultiplication += (arrayNumbers[0, b] * arrayNumbers[0, j]);
- }
- }
- }
- Console.WriteLine($"\nПроизведение: {resultMultiplication} ");
- Console.WriteLine($"Сумма {resultAddition}");
- }
Advertisement
Add Comment
Please, Sign In to add comment