c117: 張皓晴會數學
Tags :
Accepted rate : 4人/4人 ( 100% ) [非即時]
評分方式:
Tolerant

最近更新 : 2023-06-15 23:24

Content

張皓晴會數學,所以他不想寫了

請你幫幫懶惰的他完成這到題目吧

題目:

計算 $n!$

$n!=n*(n-1)*(n-2)*(n-3)......*1$

或是

$n!=n*(n-1)!  \ if \ n>0$

$0!=1$

 

Input

第一行有一個數字$n,1\leq n \leq 20$

Output

輸出$n!$

Sample Input #1
3
Sample Output #1
6
Sample Input #2
10
Sample Output #2
3628800
Sample Input #3
20
Sample Output #3
2432902008176640000
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (5%): 0.5s , <1K
公開 測資點#1 (5%): 0.5s , <1K
公開 測資點#2 (5%): 0.5s , <1K
公開 測資點#3 (5%): 0.5s , <1K
公開 測資點#4 (5%): 0.5s , <1K
公開 測資點#5 (5%): 0.5s , <1K
公開 測資點#6 (5%): 0.5s , <1K
公開 測資點#7 (5%): 0.5s , <1K
公開 測資點#8 (5%): 0.5s , <1K
公開 測資點#9 (5%): 0.5s , <1K
公開 測資點#10 (5%): 0.5s , <1K
公開 測資點#11 (5%): 0.5s , <1K
公開 測資點#12 (5%): 0.5s , <1K
公開 測資點#13 (5%): 0.5s , <1K
公開 測資點#14 (5%): 0.5s , <1K
公開 測資點#15 (5%): 0.5s , <1K
公開 測資點#16 (5%): 0.5s , <1K
公開 測資點#17 (5%): 0.5s , <1K
公開 測資點#18 (5%): 0.5s , <1K
公開 測資點#19 (5%): 0.5s , <1K
Hint :

記得要注意答案的大小
int的範圍是正負$2^{32}$

Tags:
出處:
[管理者:
TCIRC ($\mathbb{TCFSH}\ \mathtt{Comp.}\ \&\ \mathsf{Info.}\ \mathit{Club}$)
]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」