题解 | #n的阶乘#
n的阶乘
https://www.nowcoder.com/practice/97be22ee50b14cccad2787998ca628c8
#include <stdio.h> long int factorial(int n){ long int res=1; for(int i=n;i>=1;i--) res *=i; return res; } int main(){ int n; while (scanf("%d",&n)==1) printf("%ld\n",factorial(n)); return 0; }