Ruby Examples

This commit is contained in:
2026-01-15 14:01:21 +09:00
commit cf3d7d3296
76 changed files with 1191 additions and 0 deletions

14
level2/14.rb Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
=begin
문자열을 받아 길이를 반환하는 메서드
=end
def len(s)
s.length
end
print "?"
s = gets.chomp
puts "#{s}의 길이는 #{len(s)}"