题解 | #n的阶乘#
n的阶乘
http://www.nowcoder.com/practice/97be22ee50b14cccad2787998ca628c8
#include <stdio.h> int main(void) { long answr = 1; int n; scanf("%d", &n); for (int i = 1; i <= n; i++) { answr *= i; } printf("%ld\n", answr); return 0; }
n的阶乘
http://www.nowcoder.com/practice/97be22ee50b14cccad2787998ca628c8
#include <stdio.h> int main(void) { long answr = 1; int n; scanf("%d", &n); for (int i = 1; i <= n; i++) { answr *= i; } printf("%ld\n", answr); return 0; }
相关推荐