简单的函数问题~!望高手解决一下~~~
#include<stdio.h>int factorial(int num);
void main()
{
int num;
printf("请输入你要求的阶乘数\n");
scanf("%d",&num);
while(num<2)
{
printf("您输入有误,请从新输入\n");
scanf("%d",&num);
}
printf("%d\n",factorial(num));
}
int factorial(int num)
{
int i;
int sum=1;
for(i=num;i>0;i--);
{
sum*=num;
}
//return sum,num;
//printf("%d\n",sum);
return sum;
}//输出地值不对~!