Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- class Min_Max_Sum_AverageOfN
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- int[] array = new int[n];
- for (int i = 0; i < n; i++)
- {
- array[i] = int.Parse(Console.ReadLine());
- }
- Array.Sort(array);
- Console.WriteLine("min = " + array[0]);
- Console.WriteLine("max = " + array[n-1]);
- Console.WriteLine("sum = " + array.Sum());
- Console.WriteLine("avg = {0:f2} ", array.Sum()/(double)n);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement