Answer the question
In order to leave comments, you need to log in
Number generator in a certain range. how to do?
Hello. For example, I have a number 48004001680001. I want to generate a number with only the first five digits changed and the last one digit changed. That is, for example:
57869 00168000 1
88590 00168000 9
03556 00168000 8
How can I implement this? Are there special programs for this?
Answer the question
In order to leave comments, you need to log in
immutable_digits = 00168000
//shift all digits one position to the left
immutable_digits = immutable_digits * 10^1
random_number = generate a number from 0 to 99999
//shift all digits 9 places to the left
random_number = random_number * 10^9
random_number_1 = generate a number from 0 to 9
TOTAL = random_number + fixed_digits + random_number_1
ps ^ -- exponentiation
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question