static void Main(string[] args) { const int n = 1000000; const int maxValue = 100; var random = new Random(); var table = new int[n]; var check = new TableTasks(); for(int i = 0; i < n; ++i) { table[i] = random.Next(maxValue); } Console.WriteLine("\nSum of table values: {0}",check.sumOfTableValues(n,table)); Console.ReadKey(); }
static void Main(string[] args) { const int n = 1000000; const int maxValue = 100; var random = new Random(); var table = new int[n]; var check = new TableTasks(); for (int i = 0; i < n; ++i) { table[i] = random.Next(maxValue); } Console.WriteLine("\nSum of table values: {0}", check.sumOfTableValues(n, table)); Console.ReadKey(); }