Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 47399

Tasks involving random numbers and/or output.

1
vote
C# (.NET Core), 155 153 145 144 bytes using C=System.Console;class A{static void Main(){int i=int.Parse(C.ReadLine()),j=0;while((j+=new System.Random().Next(i)+1)%i<1){}C.Write(j);}} Try it onlin …
answered Apr 17 by Stackstuck
1
vote
);. static int i,j,k,l;public static void L(int p,int s){var r=new Random();var x=new int[p];for(i=0;i<p;i++)x[i]=s; for(i=0;i<s*p;){for(j=0;j<p;j++){for(l=0;l<x[j]&l<3;l++){k=r.Next(-1,5);if(k<2){if(k … : using System; //class omitted. static int i,j,k,l; public static void LCR(int pl, int sc){ var r=new Random(); var state = new int[pl]; for(i=0;i<pl;i++)state[i]=sc; for(i=0;i<sc*pl;){ for(j=0;j<pl;j …
answered Feb 20 by Stackstuck
0
votes
C# (.NET Core), 136 bytes class A{static void Main(){var r=new System.Random();int i=r.Next(6),j=6;while(i-->0)j*=1+r.Next(j);System.Console.Write(r.Next(j)+1);}} Try it online! I'm pretty sure …
answered Jun 2 by Stackstuck