整数溢出(Integer Overflows)

    class Program
    {
        static void Main(string[] args)
        {
            int value1 = int.MaxValue;
            int value2 = int.MaxValue;
            int sum = value1 + value2;
            Console.WriteLine("{0} + {1} = {2}",value1,value2,sum);

        }
    }

 

显示结果:

2147483647 + 2147483647  = -2

你可能感兴趣的:(String,Integer,Class)