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 5 years have passed since last update.

[Ruby]基礎から日記。あれはこれだ。

Posted at

今日は筑波大学の問題の34〜36。それほど難しいことはない。しかし、「def」から始まるのはメソッドだと頭では分かっているが、それがどうなる、というのはまだ身体に馴染んでいない。

[Ruby-35]

def max(a, b)
if a > b
  return a
  else
  return b
  end
end

print(max(2, 3), "\n")

これは『はじめてのRuby』P.113とほぼ同じ内容だ。本によるとreturnは省略可能だとか。ずいぶんすかすかになってしまいそうなものです。

明日はいよいよ正規表現! 難しそうだが手を動かすのみであります。

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?