using System;
namespace P10_8
{
    class OverFlowTest
    {
        static short x = 32767;   
        static short y = 32767;
        // ڼʽ
        static int CheckedMethod()
        {
            int z = 0;
            try
            {
                z = checked((short)(x + y));
            }
            catch (System.OverflowException e)
            {
                Console.WriteLine(e.ToString());
            }
            return z;
        }
    class Program
    {
            static void Main(string[] args)
            {
                Console.WriteLine("Checkedֵǣ{0}",CheckedMethod());
                Console.ReadLine();
            }
        }
    }
}
