c++ 递归思想 阶乘
2020-12-13 05:40
                         标签:结果   print   int   include   思想   ios   lse   递归   span      c++ 递归思想 阶乘 标签:结果   print   int   include   思想   ios   lse   递归   span    原文地址:https://www.cnblogs.com/zhibei/p/11145780.html 1 #include "stdio.h"
 2 #include "iostream"
 3 
 4 long fact(int n);
 5 
 6 int  main()
 7 {
 8     int i;
 9     scanf("%d", &i);
10     printf("%d 的结成结果为: %ld\n",i,fact(i));
11     system("pause");
12     return 0;
13 }
14 
15 long fact(int n)
16 {
17     if (n 1)
18         return 1;
19     else
20         return n*fact(n - 1);
21 }
下一篇:extjs下拉列表(二)