Can you display 5-digit numbers randomly from 1 to 100 at once without repetition?
I've thought about it for a long time and searched most of the posts in the forum, but it seems there are no posts that display 5-digit numbers at once, and the key is that there should be no repetition.
Sorry, I'm sorry everyone. It seems my expression ability is really problematic.
My purpose is to display random numbers from 1 to 100, display 5 at a time, and the 5 numbers displayed should not be repeated. Can everyone understand this?
First of all, thank you all for your wonderful answers. Because my batch processing level is really too low, I can't understand some advanced answers well, so please forgive me if there are any wrong evaluations.....................
1. The answer on the 6th floor basically meets the requirements, but there is an occasional dead loop phenomenon when used multiple times. I don't know the reason.
2. The one on the 13th floor has no repetition phenomenon, but the first digit is always the same every time it runs, and I always feel a little inappropriate.
3. The one on the 26th floor can also be used, but it feels too rigid. (I'm sorry, maybe the wording is inappropriate, but I can't think of a more euphemistic word, please forgive me!) For example, if I want to display 6, 7, 8, 9... digits, it's too troublesome. In fact, my original intention is to first require entering the maximum value of the random number, and then entering the number of digits to display.
4. Personally, I feel that (in terms of thinking) the one on the 32nd floor should be the most ideal, but unfortunately I can't understand it, and the brother on the 32nd floor didn't write the code as required. (Displayed 100 at once).
5. I think the code on the 33rd floor should be the best. Judging from the code, there should be absolutely no repetition, and it is very flexible. I just don't know if there will be the problems they said about low efficiency and dead loops. Currently, the running condition is good.
size]
Sorry, moderator. After repeated testing, your method on the 6th floor is okay, but there will be a dead loop. Maybe I tested too many methods and got the wrong object. I'm sorry. The method modified on the 42nd floor I think is close to perfect. There are so many good methods, batch processing is really a challenge to people's thinking
.
[ Last edited by 26933062 on 2007-1-6 at 10:07 PM ]
I've thought about it for a long time and searched most of the posts in the forum, but it seems there are no posts that display 5-digit numbers at once, and the key is that there should be no repetition.
Sorry, I'm sorry everyone. It seems my expression ability is really problematic.
My purpose is to display random numbers from 1 to 100, display 5 at a time, and the 5 numbers displayed should not be repeated. Can everyone understand this?
First of all, thank you all for your wonderful answers. Because my batch processing level is really too low, I can't understand some advanced answers well, so please forgive me if there are any wrong evaluations.....................
1. The answer on the 6th floor basically meets the requirements, but there is an occasional dead loop phenomenon when used multiple times. I don't know the reason.
2. The one on the 13th floor has no repetition phenomenon, but the first digit is always the same every time it runs, and I always feel a little inappropriate.
3. The one on the 26th floor can also be used, but it feels too rigid. (I'm sorry, maybe the wording is inappropriate, but I can't think of a more euphemistic word, please forgive me!) For example, if I want to display 6, 7, 8, 9... digits, it's too troublesome. In fact, my original intention is to first require entering the maximum value of the random number, and then entering the number of digits to display.
4. Personally, I feel that (in terms of thinking) the one on the 32nd floor should be the most ideal, but unfortunately I can't understand it, and the brother on the 32nd floor didn't write the code as required. (Displayed 100 at once).
5. I think the code on the 33rd floor should be the best. Judging from the code, there should be absolutely no repetition, and it is very flexible. I just don't know if there will be the problems they said about low efficiency and dead loops. Currently, the running condition is good.
size]
Sorry, moderator. After repeated testing, your method on the 6th floor is okay, but there will be a dead loop. Maybe I tested too many methods and got the wrong object. I'm sorry. The method modified on the 42nd floor I think is close to perfect. There are so many good methods, batch processing is really a challenge to people's thinking
.
[ Last edited by 26933062 on 2007-1-6 at 10:07 PM ]


