#!/usr/bin/env ruby # -*- coding: utf-8 -*- def hanbun(x) x/2 end puts"数値を入れてね。半分にするよ" x= gets.chomp.to_i printf("%dの半分は%d\n",x,hanbun(x))