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