14
ファイルにゼロを埋め込む
今日のタスクは、既存のファイルを取得し、特定のサイズに達するまでゼロを追加することです。 現在のディレクトリ内のファイル名fとバイト数を取得するプログラムまたは関数を作成する必要がありますb。の元のコンテンツを維持しながら、新しいサイズがバイトになるように、末尾にfゼロ(ASCIIバイトではなくヌルバイト)を書き込む必要がありbます。 あなたは、と仮定してよいfことは、当初よりも大きくないと、あなたはそれを完全なアクセス許可を持っていることを、その名前だけでASCII英数字を持っていbますが、同じ大きようなものであってもよいb、と無限の空きディスク容量があること。 f空でないと仮定したり、すでにヌルバイトが含まれていないと仮定したりすることはできません。 実行が終了した後、他の既存のファイルを変更したり、新しいファイルを作成したりしないでください。 テストケース fの内容| b | fの結果の内容 12345 | 10 | 1234500000 0 | 3 | 000 [空] | 2 | 00 [空] | 0 | [空の] 123 | 3 | 123
12
code-golf
file-system
code-golf
code-golf
string
code-golf
string
code-golf
random
game
compression
code-golf
array-manipulation
sorting
code-golf
number
arithmetic
primes
code-golf
geometry
code-golf
code-golf
decision-problem
regular-expression
code-golf
string
math
code-challenge
restricted-source
integer
palindrome
code-golf
string
palindrome
code-challenge
busy-beaver
code-golf
ascii-art
code-golf
string
code-golf
string
permutations
code-golf
code-golf
string
permutations
code-golf
number
primes
function
set-theory
code-challenge
hello-world
code-golf
math
number
decision-problem
code-golf
code-golf
sequence
arithmetic
integer
code-golf
math
number
arithmetic
decision-problem
code-golf
kolmogorov-complexity
alphabet
code-golf
combinatorics
graph-theory
tree-traversal
code-golf
set-theory
code-golf
interpreter
brainfuck
substitution
code-golf
quine
permutations