Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
Byte array to base 64 string
Sorting String Problem need help
asdcsadxasxd
Order of Ops 6.5 (added brackets)
stars
Square Integer Matrix
Validate or get the check digit of a segment of a Windows 8 / 10 activation installation ID
StudentSysInput
Fórum ➡ Border of a string S with at least 3 non-overlapping solutions ( optimized version ) ♦
Linq Func Action
Please log in to post a comment.