Newer
Older
Ruby / evenodd.rb
@mktao2 mktao2 9 days ago 213 bytes upload all files
#!/usr/koeki/bin/ruby
# -*- coding: utf-8 -*-

while true
  x  = gets.chomp
  if x == "q" then
    break
  end
  sum = x.to_i
  if sum%2 == 0
    print "偶数です\n"
  else
    print "奇数です\n"
  end
end