#!/usr/bin/env ruby # -*- coding: utf-8 -*- def hanbun(x) x/2 end puts "数値を入れてください。半分の値にします。" y = gets.to_f printf("%.1f\n", hanbun(y))