Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
Fórum ➡ GroupJoin'ing Books and Orders ( with Zip'ped output ) ♦
sortowanie ( jaka )? wybor? confirm it!
static, private, public constructor in C#
11.10
to find all substring
Add char to non-numerical words only
D113
JJ 2
https://www.fxp.co.il/showthread.php?t=21125499
C# Bubble Sort
Please log in to post a comment.