Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Working (C# thing)
//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 mainVar = 7; int i; int max = 10; int y = 0; var ran = new Random().Next(1,25); Console.WriteLine("Random int = {0}", ran); Console.WriteLine("---------------------"); for (i = 0; i <= ran; i++) { Console.WriteLine("Tested {0} times.", i); } Console.WriteLine("---------------"); for ( ; ;){ int x = new Random().Next(1,max); System.Threading.Thread.Sleep(200); // Wait func y = y + 1; if (x == 7){ Console.WriteLine("---------------"); Console.WriteLine("{0} = {1} max num = {2}", x, mainVar, max); Console.WriteLine("Finished on attempt {0}", y); break; } else{ Console.WriteLine("{0} ~= {1} max = {2}", x, mainVar, max); } } } } }
run
|
edit
|
history
|
help
0
LCM and GCD
Decimal test
asxs sxsd
Test
Animal generator (Under construction!)
count number of words in string
jdiwnnx cf
sdfghnjmkuyhtgrfed
((((STReaming))))%^%% The 2022 RBC Canadian Open Golf PGA Tour event
Problem: rstring