#include //用递归法计算阶乘 int f(int n) { return n == 0 ? 1 : f(n - 1) * n; //注意三元表达式,学生们一般不常用这个 } int main() { printf("%d\n", f(10)); return 0; }