Newer
Older
Ruby / my11.rb
@NARITA Reo NARITA Reo on 10 Sep 2021 420 bytes 2021-09-10 20:51:37
#!/usr/env/bin ruby
# -*- coding: utf-8 -*-

print("自分の年齢を入れてください。\n")
sai=gets.to_i
if sai>12
  print("僕より年上ですね!\n")
elsif sai<12
  print("僕より年下ですね!\n")
else
  print("僕と同い年ですね!\n")
end
a=3
while a>0
  sleep 1
  a=a-1
end
boku=12.to_i
print("僕の年との差を求めます。\n")
printf("僕と貴方では%d歳違いますね。\n",sai-12)