Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Find X numbers of 6 in row (dices)
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { Random Rand = new Random(); int Control = 0; double Sixes = 0; double Times = 0; var Timer = System.Diagnostics.Stopwatch.StartNew(); do { int Eyes = Rand.Next(1, 7); if (Eyes == 6) { Control++; Sixes++; } else Control = 0; Times++; } while (Control != 10); // 10 dices. Timer.Stop(); Console.WriteLine("---- Done ----"); Console.WriteLine("Times Rolled : " + String.Format("{0:n0}", Times)); Console.WriteLine("Sixes Rolled : " + String.Format("{0:n0}", Sixes)); Console.WriteLine("Time elapsed : {0}", Timer.Elapsed.TotalSeconds); } } }
run
|
edit
|
history
|
help
1
Binary Search Tree
my first
HourCouter
V 1.2
Golden Ratio Approximation
Clone Example
Login Silencioso
Padma. C#
ingresar datos por teclado
stack using LinkedList in C#