#!/usr/koeki/bin/ruby # coding: utf-8 def g(x) a = x*2 b = 1 c = a + b end STDERR.puts "数値を入れて下さい。計算した結果を出力します。" y = gets.to_i printf("%d\n", g(y))