0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

pとputsの違い 〜pの罠〜

Last updated at Posted at 2022-07-19

pとputsの違い

pの罠
p "50"puts "50"はなにが違うでしょう。

正解は、出力が

p "50"
=> "50"
puts "50"
=> 50

になることです。

AtCoderなど回答を問題文通りにしないといけない場合p "50"だと一致しないことになります。(出力を50で求められている場合)
しっかり出力結果を確認して、回答するのが良さそうですね。

では。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?