一天一段囧代码 – 记录我悲情的学习asp.net历程

using System;
using System.Collections.Generic;
using System.Text;
 
namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            int var1, var2;
 
            //录入开始
            start:
            Console.WriteLine("Enter a number:");
            var1 = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Enter another number");
            var2 = Convert.ToInt32(Console.ReadLine());
            //录入结束
 
            if (var1>10) 
            {
                if (var2 > 10)
                {
                    Console.WriteLine("都超过10,重新输入");
                    goto start;
                }
                else
                {
                    Console.WriteLine("{0}", var1);
                }
            }
            else {
                if (var2>10) {
                    Console.WriteLine("{0}",var2);
                }
                else
                    Console.WriteLine("两数都不超过10");
            }
            Console.ReadKey();
        }
    }
}

这段代码码得我全身发抖了

暧昧帖

Tags : ,

Google Reader Yahoo Facebook Twitter Digg FriendFeed Delicious Google Translate
This entry was posted onJuly 7th, 2009 at 18:31. You can follow any responses to this entry through the RSS 2.0. You can Leave a response, or Trackback.

One Response

Comments(1)Trackbacks(0)

  1. semchyk

    полезно почитать спасибо.

    2009/09/01 11:23 | #1 @

Leave a Reply

(Ctrl+Enter)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

26 queries. 0.176 seconds