0
Help us understand the problem. What are the problem?

posted at

updated at

Atcoderの問題「2 倍チェック」をrubyで解く

line = gets.chomp

if line =~ /\A[0-9]+\z/
  puts line.to_i * 2
else
  puts "error"
end

問題

image.png

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

Register as a new user and use Qiita more conveniently

  1. You can follow users and tags
  2. you can stock useful information
  3. You can make editorial suggestions for articles
What you can do with signing up
0
Help us understand the problem. What are the problem?