Rubyの数値の標準入力方法です。
number = gets.chomp.to_i
chompは改行コードを取り払う関数です。
to_iは文字列を数値に変換する関数です。
Go to list of users who liked
More than 3 years have passed since last update.
Rubyの数値の標準入力方法です。
number = gets.chomp.to_i
chompは改行コードを取り払う関数です。
to_iは文字列を数値に変換する関数です。
Register as a new user and use Qiita more conveniently
Go to list of users who liked