Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lotto unieke getallen
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int getal; int rounds = 1; Random rnd = new Random(); Console.WriteLine("De 6 LOTTO-getallen zijn:"); string seenNumbers = ":"; getal = rnd.Next(1,46); seenNumbers = string.Concat(seenNumbers,getal,":"); do{ if(rounds != 1){ getal = rnd.Next(1,46); while(seenNumbers.Contains(string.Format(":{0}:", getal))){ getal = rnd.Next(1,46); }; seenNumbers = string.Concat(seenNumbers,getal,":"); } Console.WriteLine("Getal: {0}", getal); rounds++; } while(rounds <= 6); } } }
run
|
edit
|
history
|
help
0
GeneGenerator
Alin
Uri builder
test save
123.0
T F
a
Fórum ➡ Rotating a Square Matrix One Cell Counter Clockwise
C# - a method that accepts an indefinite number of parameters
SierpinskiTriangleChaosGameRecursion