static void Main(string[] args) { Convert.ToInt32(Console.ReadLine()); int[] a = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).ToArray(); Difference d = new Difference(a); d.ComputeDifference(); Console.Write(d.maximumDifference); }
static void RunScope() { Convert.ToInt32(Console.ReadLine()); int[] numberArray = Console.ReadLine().Split(' ').Select(number => Convert.ToInt32(number)).ToArray(); var difference = new Difference(numberArray); difference.ComputeDifference(); Console.Write(difference.maximumDifference); }
public void CalculateDifference() { // Arrange int[] numbers = { 8, 19, 3, 2, 7 }; int expectedDiff = 17; Difference diff = new Difference(numbers); // Act diff.ComputeDifference(); // Assert Assert.AreEqual(expectedDiff, diff.maximumDifference); }
static void Main(string[] args) { var reader = new InputReader(false); int n = reader.NextInt; int[] elements = reader.NextArrInt; reader.Close(); var difference = new Difference(elements); difference.ComputeDifference(); Console.WriteLine(difference.maximumDifference); }