*********您好!Yadie.23很高兴能为你解答。*********
+++++++++++++++++++++++++++++++++++++++++++++++++代码很简单,我更愿意帮你检查你的代码,给些意见。。+++++++++++++++++++++++++++++++++++++++++++++++++
You can have a try,maybe my answer useful to you.
如满意,Yadie.23十分感谢您的采纳。*^-^*
#include
{
int i,n;
long sum = 1;
printf("input a number:");
scanf("%d",&n);
if( n == 0)
printf("%d != 1",n);
else
for(i = 1;i <= n;i ++)
sum *= i;
printf("%d! = %ld \n",n,sum);
}
能问下用哪种语言吗?