You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Min__Max__Sum_and_Average
{
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
double a = 0;
double min = double.MaxValue;
double max = double.MinValue;
double sum = 0;
double avg = 0;
for (int i = 0; i < n; i++)
{
a = double.Parse(Console.ReadLine());
if (a < min)
{
min = a;
}
if (a > max)
{
max = a;
}
sum += a;
}
avg = sum / n;
Console.WriteLine("min={0:f2}",min);
Console.WriteLine("max={0:f2}",max);
Console.WriteLine("sum={0:f2}",sum);
Console.WriteLine("avg={0:f2}",avg);
}
}
}
The text was updated successfully, but these errors were encountered:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Min__Max__Sum_and_Average
{
class Program
{
static void Main(string[] args)
{
}
The text was updated successfully, but these errors were encountered: