6時半起床。いつのまにか雪。
(仕事)鹿又
ローソン
旭小屋 17時半すぎ
金田一、鶴瓶、ガリレオ
2007-11-19 Mon
一番簡単に
cels2fahr-1.rb
def cels2fahr(cels)コマンドラインからデータを入力すると
fahr = cels * 9 / 5 + 32
# print("Kashi:",fahr,"\n")
print("Sesshi:",cels,"\t","Kashi:",fahr,"\n")
end
cels2fahr(3.0)
cels2fahr-2.rb
def cels2fahr(cels)解答はhttp://www.notwork.org/sbcr-ruby/answer/にあるらしい。
fahr = cels * 9 / 5 + 32
print("Sesshi:",cels,"\t","Kashi:",fahr,"\n")
end
cels = ARGV[0]
p cels
cels2fahr(cels.to_f)
4問全部終わったら見てみるか。
どの程度合っていることやら。