Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

https://pt.stackoverflow.com/q/366885/101

using System;
using static System.Console;

namespace ConsoleApplication1 {
    public class Program {
        public static void Main() {
            var numeros = new int[6];
            var rdm = new Random();
            for (int i = 1; i <= 1000000; i++) {
                WriteLine($"girei pela: {i}a. vez");
                numeros[rdm.Next(6)]++;
            }
            for (var i = 0; i < numeros.Length; i++) WriteLine($"Quantidade de vezes que o N° {i + 1} foi sorteado: {numeros[i]}");
        }
    }
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.