题解 | #n的阶乘#
n的阶乘
https://www.nowcoder.com/practice/97be22ee50b14cccad2787998ca628c8
#include "cstdio" int main() { int n; scanf("%d", &n); long long result = 1; while (n > 0) { result *= n; --n; } printf("%lld", result); return 0; }
n的阶乘
https://www.nowcoder.com/practice/97be22ee50b14cccad2787998ca628c8
#include "cstdio" int main() { int n; scanf("%d", &n); long long result = 1; while (n > 0) { result *= n; --n; } printf("%lld", result); return 0; }
相关推荐