случайные-числа

Filling a two-dimensional array with random numbers in c++

An array of random size is created, which is filled with random numbers. For some reason, each line is the same. #include &l ... ndl; } /* проверка размера cout << m << endl; cout << n << endl; */ return 0; }

Random number from 1 to 100

Why is one added to the result in this code? console.log(Math.floor(Math.random() * 100) + 1); Will this code output a number from 1 to 100 inclusive, or from 2 to 99?

Filling an array with random numbers in C

Studying arrays, I came to the question, how can I create an array and fill it with absolutely random values? There are resou ... e responsible for this, how many different methods there are, and what ways it is best to do it so that it really is random.

Class-matrix with random values

The goal is to create a matrix class that can create two-dimensional arrays of specified sizes, but with random values. The ... ocale(LC_ALL, "ru"); Matrix a(3, 3); Matrix b(3, 3); b.FillMatrix(); a.FillMatrix(); a.PrintMatrix(); b.PrintMatrix(); }

Place the points in random order without intersections

It is required to know the reference coordinates (for example (0,0)) arrange 30 points around it, so that they stand as if ra ... circle was not too large, so that the points were not too far away. What algorithm can be used to get what is in the picture?

How to generate a large non-negative random number?

There is such a task: to generate a random positive natural number whose size in bits is, well, say 256. Can you tell me how ... check for a sign and generate again, it seems to me very inefficient in time, or am I wrong and it is worth doing just that?

What is the probability that out of 5 cards, 4 will be of the same suit?

There is a deck with an infinite number of cards, we draw 5 cards from there. What is the probability that out of 5-and 4-wil ... hat formula should be considered in such a task, because the task can be very difficult and there is no way without a formula

Random number between A and B

I wrote a program in which the user can set the numbers A and B. A is the minimum number. B - the maximum number. That is, ... a ; x = a + rand() % b ; printf ("Max number:") ; cin >> b ; printf ("Random number:") ; cout << x ; }

Generate a random number from 100000 to 1000000

Generate a random number from 100000 to 1000000. There is a running time, but the problem is that the number is constantly ge ... t << "Numeric " << desiredNumber << " in number " << generatedNumber << " does not occur\n"; }