How to use an ASP program to randomly divide 100 numbers from 0 to 99 into 10 groups

Updated on educate 2024-03-18
7 answers
  1. Anonymous users2024-02-06

    with random numbers. Cyclic generation, the next generation checks whether the generated random number has been generated.

  2. Anonymous users2024-02-05

    I will only practice.

    Sorry for not saying.

  3. Anonymous users2024-02-04

    Analysis:

    1) Generate 50 numbers, the sum is equal to 200, meaning 200 50 = 4 Each number is averaged as 4

    2) Each random number cannot be generated arbitrarily, otherwise the sum of 50 numbers cannot be guaranteed to be 200

    3) Generate the first (or first) random numbers, in the range of 1 - 9, as the number of numbers generated, the range may become smaller (meaning the range = 1 - less than 9 values).

    4) Calculate the maximum value of the current limit = (200 - the sum of the generated numbers) - the number of remaining numbers "-1) *1

    If the result is greater than 9, it is 9

    5) Calculate the minimum value of the current limit = (200 - the sum of the generated numbers) - the number of remaining numbers "-1) *9

    If the result is less than 1, it is 1

    6) The last number (i.e. the 50th) cannot be randomly generated, otherwise there is no guarantee that the result will be equal to 200

    The following ** have been tested.

    class program

    else The last digit cannot be randomly generated, otherwise there is no guarantee that the total generated will be equal to 200.

    Current Value: , Current Cumulative Value:"current, sum);;

  4. Anonymous users2024-02-03

    int count =50;Quantity 50

    int max = 200;and for 200

    int array = new int[count];Stores the generated random number.

    int sum = 0;Initializes the sum of the generated random numbers.

    random random = new random();

    for(int i = 0 ; i < i++ count--)

    else the first 49 numbers.

    After the end of the loop, the sum of 50 random numbers is satisfied to 200, all of which are stored in the array and called as needed.

    If you write it by hand, there may be a misspelling of some words, so the landlord can try it.

    No, the condition judgment is wrong, I think about it.

    Forehead. It seems to be right.,The landlord saw that you can go to the actual environment to try it.,I'm off work.,The computer at home isn't even installed vs.,It's inconvenient to try.。 Even if the local values are not very accurate, there is certainly nothing wrong with the idea.

    Uh, upstairs faster than me, tragedy.

  5. Anonymous users2024-02-02

    Is it all combined? Or is it just a combination?

  6. Anonymous users2024-02-01

    lz This is a console application You didn't say what type you wanted, give this first.

    static void main(string args)if (count ==200)

    and for" +count);

    flag = 10;

  7. Anonymous users2024-01-31

    Add using at the front, or directly in front of graphics.

Related questions
8 answers2024-03-18

There is a corresponding ** on the Internet, you can check it yourself!

10 answers2024-03-18

Random numbers in pascal.

Random numbers refer to a series of numbers that theoretically have no rules to follow, have an equal probability of each number appearing within a specified range, and cannot be used to follow the previous number. The basic principle of a general random number generator is: first, initialize a random seed, the initial value of which can be an arbitrary integer; Every time a random number is obtained, a special operation is performed based on the random seed, a random number is obtained and returned, and then some operation is performed on the random seed to change the value of the random seed. >>>More

8 answers2024-03-18

Because you're superimposing, it should be n+(n-1)+

So sum(n-1) should be called. >>>More

13 answers2024-03-18

2. In the second step, if you want to get the brand of the phone or tool you are debugging, you can use brand. >>>More

14 answers2024-03-18

Automate knowledge management. Office automation makes all kinds of documents electronic, and realizes the storage of documents in the form of electronic filing cabinets, and uses and shares them according to permissions. >>>More