#45906: 沒我暴力!!!!! python


dasabi (dasabi)

學校 : 陽明國中
編號 : 303223
來源 : [36.239.112.206]
最後登入時間 :
2025-05-11 11:15:43
d487. Order's computation process -- 學姊 | From: [1.173.183.230] | 發表日期 : 2025-04-27 12:41

def n(x):
    
    if x == 0:
        return ("0! = 1 = 1")
    
    if x == 1:
        return ("1! = 1 = 1")
  
    if x == 2:
        return ("2! = 2 * 1 = 2")
    
    if x == 3:
        return ('3! = 3 * 2 * 1 = 6')
    
    if x == 4:
        return ('4! = 4 * 3 * 2 * 1 = 24')
    
    if x == 5:
        return ('5! = 5 * 4 * 3 * 2 * 1 = 120')
  
    if x == 6:
        return ('6! = 6 * 5 * 4 * 3 * 2 * 1 = 720')
    
    if x == 7:
        return ('7! = 7 * 6 * 5 * 4 * 3 * 2 * 1 = 5040')
    
    if x == 8:
        return ('8! = 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1 = 40320')
    
    if x == 9:
        return ('9! = 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1 = 362880')
    
    if x == 10:
        return ('10! = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1 = 3628800')
    
import sys
for s in sys.stdin:
    print(n(int(s)))

 

 
ZeroJudge Forum