#include<stdio.h> int main() { int n; scanf("%d",&n); int face=1; int i=1; while(i<=n){ face*=i; i++; } printf("%d!=%d\n",n,face); }
n=1*2*3*4……
n!=?
#include <stdio.h> int main() { int i,n; double sum=1; scanf("%d",&n); for(i=1;i<=n;i++) sum=sum*i; printf("%d!=%lf",n,sum); printf("\n"); return 0; }
标签:include,int,scanf,算法,阶乘,main From: https://www.cnblogs.com/xiongwei/p/16850440.html