30
最初に0ではなく、個別の数字でランダムなn桁の数字を取得します
私はこの質問を読み、それがいい挑戦になると思った。 仕事 入力0<n<10で乱数を生成する 正確にn桁 最初ではない 0 そう f(n)>10**(n-1)-1 個別の数字 受賞基準 これはコードゴルフなので、最短のコードが優先されます。 ランダム ランダムに均等に分散されるということです。そのため、プログラムの観点からは、考えられる各数字には同じチャンスがあります。あなたが書いている言語が奇妙な乱数ジェネレーターを持っているなら、それを使用しても大丈夫です。 例 ランダムに選択する値のリストn=2は次のとおりです。 [10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, …
22
code-golf
number
random
grid
game
king-of-the-hill
javascript
code-golf
arithmetic
statistics
code-golf
math
code-golf
math
code-golf
string
palindrome
code-golf
string
interactive
code-golf
quine
polyglot
code-golf
string
stack-exchange-api
code-golf
number-theory
decision-problem
code-golf
tips
code-golf
string
internet
code-golf
graphical-output
image-processing
fractal
code-golf
ascii-art
geometry
hexagonal-grid
code-golf
string
restricted-source
hello-world
code-golf
game
code-golf
cipher
code-golf
permutations
cops-and-robbers
permutations
cops-and-robbers
code-golf
internet
stack-exchange-api
code-golf
ascii-art
random
code-golf
tips
code-golf
ascii-art
code-golf
code-golf
kolmogorov-complexity
code-golf
string
unicode
code-golf
number
sequence
primes
palindrome
code-golf
game
decision-problem
code-golf
math
geometry
code-golf
graphical-output
interactive
code-golf
set-partitions
code-golf
number
arithmetic
restricted-source
code-golf
decision-problem
python
recursion
code-golf
ascii-art
code-golf
source-layout
code-golf
function
recursion
functional-programming
code-golf
game
combinatorics
permutations
code-golf
string
file-system
code-golf
string
hashing
code-golf
stack-exchange-api
code-golf
string
code-golf
math
number
arithmetic
polyglot