#include<stdio.h> long fac(unsigned n) { if (n == 0 || n == 1) return 1; else return (n * fac(n - 1)); } int main() { unsigned ui, a; printf("输入计算的阶乘:"); scanf("%u", &ui); printf("%u 的阶乘对2018取模的结果:%u\n",ui, fac(ui)%2018); return 0; }