Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

saved 2 bytes
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES8), 158(削除) 158 (削除ここまで) 156 bytes

Expects (a)(b), where both arguments are strings.

a=>b=>" "[R='repeat'](q=(A=a.length)+1&~1+A%2)+` ${"_"[R](b.length)}
${a.padEnd(q)}/${b} = ${(b**(1b**=1/a)).toFixed(A)}
`+(g=p=>q?p+" "[R](q-=2)+`/
`+g(" "+p):"")`\\`

Try it online! Try it online!

JavaScript (ES8), 158 bytes

Expects (a)(b), where both arguments are strings.

a=>b=>" "[R='repeat'](q=(A=a.length)+1&~1)+` ${"_"[R](b.length)}
${a.padEnd(q)}/${b} = ${(b**(1/a)).toFixed(A)}
`+(g=p=>q?p+" "[R](q-=2)+`/
`+g(" "+p):"")`\\`

Try it online!

JavaScript (ES8), (削除) 158 (削除ここまで) 156 bytes

Expects (a)(b), where both arguments are strings.

a=>b=>" "[R='repeat'](q=(A=a.length)+A%2)+` ${"_"[R](b.length)}
${a.padEnd(q)}/${b} = ${(b**=1/a).toFixed(A)}
`+(g=p=>q?p+" "[R](q-=2)+`/
`+g(" "+p):"")`\\`

Try it online!

Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES8), 158 bytes

Expects (a)(b), where both arguments are strings.

a=>b=>" "[R='repeat'](q=(A=a.length)+1&~1)+` ${"_"[R](b.length)}
${a.padEnd(q)}/${b} = ${(b**(1/a)).toFixed(A)}
`+(g=p=>q?p+" "[R](q-=2)+`/
`+g(" "+p):"")`\\`

Try it online!

AltStyle によって変換されたページ (->オリジナル) /