LoginSignup
0
0

More than 3 years have passed since last update.

Rubyの数値の標準入力方法

Posted at

Rubyの数値の標準入力方法です。

number = gets.chomp.to_i

chompは改行コードを取り払う関数です。
to_iは文字列を数値に変換する関数です。

0
0
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
0
0