Problem 16 (written in Ruby)
tomotaka-mbp:~ tomotaka$ irb
>> (2**1000).to_s.scan(/./).map{|s|s.to_i}.inject(0){|r,s| r+=s}
=> 1366
ワンライナー楽しす。
Problem:
http://odz.sakura.ne.jp/projecteuler/index.php?Problem%2016
tomotaka-mbp:~ tomotaka$ irb
>> (2**1000).to_s.scan(/./).map{|s|s.to_i}.inject(0){|r,s| r+=s}
=> 1366
ワンライナー楽しす。
Problem:
http://odz.sakura.ne.jp/projecteuler/index.php?Problem%2016