Ruby Examples
This commit is contained in:
11
level1/04.rb
Executable file
11
level1/04.rb
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/ruby
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
=begin
|
||||
숫자를 입력받아 짝수/홀수 판별
|
||||
=end
|
||||
|
||||
print "숫자 : "
|
||||
number = gets.chomp.to_i
|
||||
|
||||
puts number.even? ? "짝수" : "홀수"
|
||||
Reference in New Issue
Block a user