麦田

不积跬步无以至千里.

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _02复习流程控制
{
    class Program
    {
        static void Main(string[] args)
        {
            // 该方法输出里面的第一个参数
            Console.WriteLine("您好,请选择业务范围:");
            Console.WriteLine("1、查询");
            Console.WriteLine("2、取款");
            Console.WriteLine("3、退出");
            // 读取用户在屏幕上输入的一句话(是一个字符串,输入时一回车表示结束)
            #region if else if
            //string str = Console.ReadLine();
            //if (str == "1")
            //{
            //    Console.WriteLine("查询的方法");
            //}
            //else if (str == "2")
            //{
            //    Console.WriteLine("取款的方法");
            //}
            //else if (str == "3")
            //{
            //    Console.WriteLine("退出");
            //}
            //else
            //{
            //    Console.WriteLine("输入错误");
            //} 
            #endregion

            string str = Console.ReadLine();

            switch (str)
            {
                case "1": Console.WriteLine("查询的方法"); break;
                case "2": Console.WriteLine("取款的方法"); break;
                case "3": Console.WriteLine("退出"); break;
                default: Console.WriteLine("输入错误"); break;
            }

            Console.ReadKey();
        }
    }
}

 

posted on 2012-12-21 20:21  一些记录  阅读(260)  评论(0)    收藏  举报