c语言实现n的阶乘

来源:互联网 发布:顾比均线指标源码 编辑:程序博客网 时间:2024/06/05 05:05

#define _CRT_SECURE_NO_WARNINGS 1

#include   stdio.h>

#include   <stdlib.h>

int      main()

{

    int    i = 0;

    int     n=0;

    scanf("%d",&n);

    int   ret = 1;

    for(i=n;i>=1;i--)

  {

     ret = ret *i;

   }

    printf("%d\n",ret);

   system ("pause\n");

    return 0;

}


1 0
原创粉丝点击