Hello!
I want to write code that calculates the arithmetic average of a series of numbers. Please tell me how to do it. Take an array? Or something different? I need the user to enter how many numbers he wants.
Hello!
I want to write code that calculates the arithmetic average of a series of numbers. Please tell me how to do it. Take an array? Or something different? I need the user to enter how many numbers he wants.
Console.WriteLine(Console.ReadLine().Split().Select(int.Parse).Average()); The user must enter at least one number, otherwise it will fall.
Source: https://ru.stackoverflow.com/questions/522593/
All Articles