Newer
Older
Ruby / kuku.rb
@MIZUNO Manaka MIZUNO Manaka on 2 Aug 2022 360 bytes 2022-08-02 16:02:38
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

def kuku(kakerareru, kakeru)
  if kakerareru < 0 || kakeru < 0
    return nil
  end
  return kakerareru*kakeru
end

puts "九九の計算をします。"
print "かけられる数を入力:"
suzi1 = gets.to_i
print "かける数を入力:"
suzi2 = gets.to_i
printf("解答は%dです。\n", kuku(suzi1, suzi2))