Sha256: 6517f9bca7966c81072c818d1d4bcec000c6e3416dacf1e3a4553d60e0efe470

Contents?: true

Size: 468 Bytes

Versions: 35

Compression:

Stored size: 468 Bytes

Contents

コマンドラインから2つの引数を受け取って数値に変換し、その和、差、積、商を表示するプログラムを作成せよ。


- 変数

変数名 = オブジェクト


- .to_i

変数名 = オブジェクト.to_i

オブジェクトの直後に記述することで、そのオブジェクトを数値に変換する。
ARGVは引数を文字列として受け取るため、そのままでは計算には使えないことに注意。

Version data entries

35 entries across 24 versions & 1 rubygems

Version Path
ruby_learner-1.2.9 contents/takahashi/sample_prog/question/2_2.org
ruby_learner-1.2.8 contents/takahashi/sample_prog/question/2_2.org
ruby_learner-1.2.7 contents/takahashi/sample_prog/question/2_2.org
ruby_learner-1.2.6 contents/takahashi/sample_prog/question/2_2.org
ruby_learner-1.2.5 contents/takahashi/sample_prog/question/2_2.org
ruby_learner-1.2.4 contents/takahashi/sample_prog/question/2_2.org
ruby_learner-1.2.3 contents/takahashi/sample_prog/question/2_2.org
ruby_learner-1.2.2 contents/takahashi/sample_prog/question/2_2.org
ruby_learner-1.2.1 contents/takahashi/sample_prog/question/2_2.org
ruby_learner-1.2.0 contents/takahashi/sample_prog/question/2_2.org
ruby_learner-1.1.15 takahashi/sample_prog/question/2_2.org
ruby_learner-1.1.14 takahashi/sample_prog/question/2_2.org
ruby_learner-1.1.13 takahashi/sample_prog/question/2_2.org
ruby_learner-1.1.11 questions/sequential_check/section_2/part_2/lib/sentence.org
ruby_learner-1.1.11 takahashi/sample_prog/question/2_2.org
ruby_learner-1.1.10 questions/sequential_check/section_2/part_2/lib/sentence.org
ruby_learner-1.1.10 takahashi/sample_prog/question/2_2.org
ruby_learner-1.1.9 questions/sequential_check/section_2/part_2/lib/sentence.org
ruby_learner-1.1.9 takahashi/sample_prog/question/2_2.org
ruby_learner-1.1.8 questions/sequential_check/section_2/part_2/lib/sentence.org