C#中的goto

int i = 9;
if (i % 2 == 0) goto Found;
else goto NoFound;


        NoFound:
            Console.WriteLine(i.ToString() + "不是偶数");
            goto finish;//出口点
        Found:
            Console.WriteLine(i.ToString() + "为偶数");
            goto finish; //出口点
        finish:
            Console.Read();

posted @ 2013-07-17 19:40  pnljs  阅读(791)  评论(0编辑  收藏  举报