第五章例5-9

#include<stdio.h>
double fact_s(int n);
int main(void)
{
    int i,n;
    printf("Input n:");
    scanf_s("%d",&n);
    for(i=1;i<=n;i++)
        printf("%3d!=%.0f\n",i,fact_s(i));

    return 0;
}
double fact_s(int n)
{
    static double f=1;
    f=f*n;

    return(f);
}

posted @ 2013-10-06 20:53  刘睿1994  阅读(103)  评论(0编辑  收藏  举报