小编Jav*_*ael的帖子

需要计算中位数和众数,C#

我需要组织数字并从任意数量的数字中获取中位数和众数,所以我尝试了不同的方法来实现这一点,但我就是无法找到解决方案。

public static void Main()
        {
            int i, n;
            int[] a = new int[100];
    
            Console.Write("\n\nRead n number of values in an array and display it in reverse order:\n");
            Console.Write("------------------------------------------------------------------------\n");
    
            Console.Write("Input the number of elements to store in the array :");
            n = Convert.ToInt32(Console.ReadLine());
    
    //quantity of numbers to insert
            Console.Write("Input {0} number of elements in the array :\n", n);
            for (i = 0; i < n; i++)
            {
                Console.Write("element - {0} : ", i);
                a[i] = Convert.ToInt32(Console.ReadLine());
            }
    //individial numbers to …
Run Code Online (Sandbox Code Playgroud)

c# math mode median

2
推荐指数
1
解决办法
2689
查看次数

标签 统计

c# ×1

math ×1

median ×1

mode ×1