编辑代码

using System;

public class HelloWorld
{
    public static void Main()
    {
        // 整数溢出
        int a = int.MinValue;
        a--;
        Console.WriteLine($"The value of int.MinValue-- is equal to int.MaxValue {a == int.MaxValue}");

        int b = int.MinValue;

        try {
            int c = checked(b--);
        }
        catch(Exception ex) {
            Console.WriteLine($"The type of exception is {ex.GetType()}");
        }
    }
}