1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Project Euler Q40 【チャンパーノウン定数】

Last updated at Posted at 2017-12-07

Project Eulerをワンライナーで解いてみる。
間違っていたらコメントください。

問題

正の整数を順に連結して得られる以下の$10$進の無理数を考える:
$0.123456789101112131415161718192021...$

小数第$12$位は$1$である.

$d_n$で小数第$n$位の数を表す. $d_1 × d_{10} × d_{100} × d_{1000} × d_{10000} × d_{100000} × d_{1000000}$ を求めよ.

解答

seq -s "" 999999 |
awk -v FS= '{s=1;for(i=0;i<=6;i++){s*=$(10^i)};print s}'
210

答え合わせ

こちらのサイト様と一致していればOKとした。
http://kingyojima.net/pje/040.html

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?