求高手求解C语言(函数调用)问题
希望高手能指点一下我这个新手{:5_92:} #include <stdio.h>int fun(int n)
{
int i, sum = 1;
for ( i = 2; i <= n; i++ )
sum = sum * i;
return sum;
}
int main()
{
int n;
int sum;
printf("输入一个数:");
scanf("%d", &n);
sum = fun(n);
printf("%d 的阶乘是:%d\n", n, sum);
return 0;
}
页:
[1]