我在程序的空运行中遇到问题。我不明白为什么我的程序在输出中给出 0。这是我的代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Task_8_Set_III
{
class Program
{
static void Main(string[] args)
{
int i = 3;
int c = i / fact(i);
Console.WriteLine("Factorial is : " + c);
Console.ReadLine();
}
static int fact(int value)
{
if (value ==1)
{
return 1;
}
else
{
return (value * (fact(value - 1)));
}
}
}
}