2019 iT 邦幫忙鐵人賽
分享至
嗨,我是 Fly,用 Ruby 寫 Chatbot 並挑戰30天分享心得為確保不會沒靈感每日含 Ruby 解題增加內容https://www.hackerrank.com/domains/tutorials/30-days-of-code
def factorial(n) n>0 ? n*factorial(n-1) : 1 end n = gets.to_i result = factorial n puts result
IT邦幫忙