Ruby Examples
This commit is contained in:
14
level2/14.rb
Executable file
14
level2/14.rb
Executable 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)}"
|
||||
Reference in New Issue
Block a user