Newer
Older
Ruby / happyou.rb
@KONNO Eita KONNO Eita on 12 Dec 2022 648 bytes 2022-12-12 20:59:54
#!/usr/bin/evn ruby
# -*- coding: utf-8 -*-

requie 'csv'
puts"予定表"
hiniti1 = gets.chomp #ファイルに入れたい日にちの変数
yotei1 = gets.chomp  #ファイルに入れたい予定の変数
 CSV.open("yotei.csv","a+")do |yotei| #ファイルを開いて入力
puts"日にちを最初に入れてね"
puts"例、12月17日"
yotei << ["日にち","hiniti1"] #日にち
puts"予定を入れてね"
puts"例、発表会"
yotei << ["予定","yotei1"] #予定
end







deta = CSV.read("yotei.csv",:headers => true) #読み込み、表示
deta.each{[row]
printf("%s\n",
       row["日にち"])
printf("%s\n",
       row["予定"])
}