diff --git a/hello16.rb b/hello16.rb index d364f4a..0db4562 100644 --- a/hello16.rb +++ b/hello16.rb @@ -1,4 +1,4 @@ # # -a |= "0000" .to_i -p(a) +a=12345 +p("#{a}".length) diff --git a/hello17.rb b/hello17.rb new file mode 100644 index 0000000..465defb --- /dev/null +++ b/hello17.rb @@ -0,0 +1,6 @@ +# +# +(1..50).each { |i| + int=("#{i}").split.map(% :to_i ) + printf("%d,%d\n",i,int.sum) +}