求N个数的阶乘,并能正确输出。
Code
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace Fiblaji
6{
7 class Program
8 {
9 static void Main(string[] args)
10 {
11 Console.WriteLine(fun2(100));
12
13 }
14 public static Double fun2(int i)
15 {
16 if (i <= 1)
17 return 1;
18 else
19 return i * fun2(i - 1);
20
21 }
22 }
23}
24
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace Fiblaji
6{
7 class Program
8 {
9 static void Main(string[] args)
10 {
11 Console.WriteLine(fun2(100));
12
13 }
14 public static Double fun2(int i)
15 {
16 if (i <= 1)
17 return 1;
18 else
19 return i * fun2(i - 1);
20
21 }
22 }
23}
24