HUSTOJ
Home
ProblemSet
Source/Category
Contest
Status
Ranklist
F.A.Qs
ContestProblemSetList
Login
Register
Problem D: 求n的阶乘(for循环)
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:29
Solved:19
Return to contest
Submit
Submit Record
ShowOff!
Description
输入一个正整数n(n<=12),求n的阶乘(n!=1*2*3*...*n)
Input
输入一个正整数
Output
输出n!的值
Sample Input
Copy
3
Sample Output
Copy
6
HINT
1、当n=0时,n!=0!=1
2、当n为大于0的正整数时,n!=1×2×3×…×n
一个正整数的阶乘(factorial)是所有小于及等于该数的正整数的积。自然数n的阶乘写作n!。
Source/Category
for
循环结构