using DocumentFormat.OpenXml.Spreadsheet;
using System;
using System.Collections.Generic;
using System.Text;
namespace KnowledgePoint
{
class _30_ArgsOut
{
static void Main(string[] args)
{
int[] numArr = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
Console.WriteLine("数组元素展示:");
for (int i = 0; i < numArr.Length; i++)
{
Console.Write(numArr[i] + " ");
}
Console.WriteLine("\n");
int[] resultSet = ReturnExtvalueSumAvgOfArray(numArr);
Console.WriteLine("数组元素的最大值为{0},最小值为{1},总和为{2},平均值为{3}", resultSet[0], resultSet[1], resultSet[2], resultSet[3]);
Console.ReadKey();
}
/// <summary>
/// 返回数组的两个最值、总和以及平均值
/// </summary>
/// <param name="numArr"></param>
private static int[]
C#编写返回相同类型的值的方法(元素最值、总和、平均值)
最新推荐文章于 2021-03-03 21:07:14 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)