Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Diagnostics;
- namespace ConsoleApp1
- {
- class ConsoleApp1
- {
- private static void Main(string[] args)
- {
- Console.WriteLine("Введите кол-во строк: ");
- int n = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Введите кол-во столбцов: ");
- int m = Convert.ToInt32(Console.ReadLine());
- double N = 1;
- double[,] array = new double[n + 1, m + 1];
- var timer = Stopwatch.StartNew();
- for (int i = 1; i < n + 1; i++)
- {
- L = 0;
- for (int j = 1; j < m + 1; j++)
- {
- array[i, j] = Math.Sqrt((i-1)+(j-1));
- L += array[i, j];
- }
- N *= L;
- }
- Console.WriteLine("Результат - " + "{0:0.00}", N);
- timer.Stop();
- Console.WriteLine("Выполнение метода заняло {0} мс", timer.ElapsedMilliseconds);
- Console.WriteLine("Выполнение метода заняло {0} тактов", timer.ElapsedTicks);
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment