📜  c# 素数分解 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:55.431000             🧑  作者: Mango

代码示例1
class Program
{
    static void Main(string[] args)
    {
        int a, b;
        Console.WriteLine("Please enter your integer: ");
        a = int.Parse(Console.ReadLine());
        for (b = 1; b <= a; b++)
        {
            if (a % b == 0)
            {
                Console.WriteLine(b + " is a factor of " + a);
            }
        }
    }
}