void maino Int nI long int fac=l printi("请输入一个正整数:") fac*=i++ /*做累乘运算* while(i<=n /*循环结束的条件是in+1* printf("%d=%ld\n",n, fac);
void main() { int n,i=2; long int fac=1; printf("请输入一个正整数:"); scanf("%d",&n); do fac*=i++; /*做累乘运算*/ while(i<=n); /*循环结束的条件是 i=n+1*/ printf("%d!=%ld\n",n,fac); }