#!/usr/koeki/bin/ruby # coding: utf-8 def f(x) 2*x + 1 end STDERR.puts "数値を入れて下さい。2倍して1足します。" y = gets.to_i printf("%d\n", f(y))