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 ใƒฆใƒผใ‚ถ ใฎ ๅ…ฅๅŠ›ๆ–‡ๅญ—ๅˆ— ใ‚’ ๅค‰ๆ•ฐ ใซ ๆ ผ็ดใ™ใ‚‹

0
Posted at

็›ฎ็š„

  • Rubyใซใฆใƒฆใƒผใ‚ถใ‹ใ‚‰ใฎๅ…ฅๅŠ›ๆ–‡ๅญ—ๅˆ—ใ‚’ๅ—ใ‘ๅ–ใ‚Šใ€ๅค‰ๆ•ฐใซๆ ผ็ดใ™ใ‚‹ๆ–นๆณ•ใ‚’ใพใจใ‚ใ‚‹ใ€‚

ๆ›ธใๆ–นใฎไพ‹

  • ๅ…ฅๅŠ›ๅ€คใ‚’ๅ—ใ‘ๅ–ใ‚‹ใซใฏใƒกใ‚ฝใƒƒใƒ‰getsใ‚’ไฝฟ็”จใ™ใ‚‹ใ€‚
  • ๅ…ฅๅŠ›ๅ€คใฎๆ”น่กŒใ‚‚ใชใใ—ใฆๅค‰ๆ•ฐใซๆ ผ็ดใ—ใŸใ„ใŸใ‚ใ‚ชใƒ—ใ‚ทใƒงใƒณchompใ‚’ไป˜ใ‘ใ‚‹ใ€‚
  • ไธ‹่จ˜ใซๅ‡ฆ็†ใ‚’่จ˜่ผ‰ใ™ใ‚‹ใ€‚
ๅค‰ๆ•ฐ = gets.chomp

ใ‚ˆใ‚Šๅ…ทไฝ“็š„ใชไพ‹

  • ๅ…ฅๅŠ›ใ•ใ‚ŒใŸๆ–‡ๅญ—ๅˆ—ใ‚’ใ‚ณใƒณใ‚ฝใƒผใƒซใซๅ‡บๅŠ›ใ™ใ‚‹ๅ‡ฆ็†ใ‚’่€ƒใˆใ‚‹ใ€‚
  • ใ‚ณใƒณใ‚ฝใƒผใƒซใซใฏใ€Œๅฅฝใใชๆ–‡ๅญ—ๅˆ—ใ‚’ๅ…ฅๅŠ›ใ—ใฆใใ ใ•ใ„ใ€‚ใ€ โ†’ ๅ…ฅๅŠ›ๅพ…ใก โ†’ ใ€Œๅ…ฅๅŠ›ใ•ใ‚ŒใŸๆ–‡ๅญ—ๅˆ—ใฏโ—‹โ—‹ใงใ™ใ€‚ใ€ใจ่กจ็คบใ•ใ‚Œใ‚‹ใ‚ˆใ†ใซใ™ใ‚‹ใ€‚
  • ๅ…ฅๅŠ›ใ•ใ‚ŒใŸๆ–‡ๅญ—ๅˆ—ใฏๅค‰ๆ•ฐinputใซๆ ผ็ดใ™ใ‚‹ใ€‚
  • ไธ‹่จ˜ใซๅ‡ฆ็†ใ‚’่จ˜่ผ‰ใ™ใ‚‹ใ€‚
puts "ๅฅฝใใชๆ–‡ๅญ—ๅˆ—ใ‚’ๅ…ฅๅŠ›ใ—ใฆใใ ใ•ใ„ใ€‚"
input = gets.chomp
puts "ๅ…ฅๅŠ›ใ•ใ‚ŒใŸๆ–‡ๅญ—ๅˆ—ใฏ#{input}ใงใ™ใ€‚"
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?