예제 #1
0
        public string TaoMang(int n)
        {
            Random rd = new Random();

            int[] arr = new int[n];
            for (int i = 0; i < n; i++)
            {
                arr[i] = rd.Next(100);
            }
            string s  = "";
            cXuLy  bt = new cXuLy();

            s = bt.InKetQua(s, arr);
            return(s);
        }
예제 #2
0
        public string SapXepGiamDan(int[] arr, int n)
        {
            for (int i = 0; i < n - 1; i++)
            {
                for (int j = i + 1; j < n; j++)
                {
                    if (arr[i] < arr[j])
                    {
                        int temp = arr[i];
                        arr[i] = arr[j];
                        arr[j] = temp;
                    }
                }
            }
            string s  = "";
            cXuLy  bt = new cXuLy();

            s = bt.InKetQua(s, arr);
            return(s);
        }