小编Law*_*iet的帖子

C#程序仅在步进模式下正常工作

using System;
using System.Linq;

namespace Loto
{
    class Program
    {
        static void Main(string[] args)
        {
            short[] tirage = new short[6]; //array that contains the numbers
            short nbTirage; //the number randomed

            for (int i = 0; i < 6; i++)
            {
                nbTirage = NombreAleatoire();

                while (tirage.Contains(nbTirage)) //if the number has already been drawn
                {
                    nbTirage = NombreAleatoire(); //we random another one
                }

                Console.Write(nbTirage + " "); //writing the result
            }
        }

        static short NombreAleatoire()
        {
            Random nb = new Random();
            return …
Run Code Online (Sandbox Code Playgroud)

c# debugging

0
推荐指数
1
解决办法
157
查看次数

标签 统计

c# ×1

debugging ×1