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 }

 

相关文章:

  • 2021-07-27
  • 2021-10-18
  • 2021-08-11
  • 2022-01-18
  • 2022-02-21
  • 2021-12-06
  • 2021-08-28
  • 2021-05-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-01
  • 2022-02-20
  • 2021-07-07
相关资源
相似解决方案