zoukankan      html  css  js  c++  java
  • 19,随机数,不重复。

                Random rnd = new Random();
                ArrayList al = new ArrayList();

                for (int i = 1; i <= 9; i++)
                {
                    al.Add(i);
                }

                ArrayList al2 = new ArrayList();

                while (al.Count > 0)
                {
                    int i=rnd.Next(al.Count - 1);
                 
                    al2.Add(al[i]);

                    al.RemoveAt(i);
                }

                if (al2[8].ToString().Equals("9"))
                {
                    int i = rnd.Next(0, 8);
                    int iz = Convert.ToInt32(al2[i].ToString());
                    al2[8] = iz;
                    al2[i] = 9;
                }

                this.textBox1.Text = al2[0] + "," +

  • 相关阅读:
    Easy-Transfer学习
    录音+语音转文字
    pyQt点击事件和数据传输
    第一个python-ui界面
    python写第一个网页
    pyhthon第一个小脚本——文件备份
    Stones HDU 1896
    Cow Sorting POJ 3270 & HDU 2838
    Stones
    大数相加
  • 原文地址:https://www.cnblogs.com/binlunia/p/11267735.html
Copyright © 2011-2022 走看看