国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > C# > 正文

choosesubject c# switch

2020-01-24 03:46:04
字體:
來源:轉載
供稿:網友
復制代碼 代碼如下:

using System;
class ChooseSubject
{
    static void Main()
    {
        int i;
        string str;
        Console.WriteLine ("Please choose your favorite subjects:-1 is quit.");
        Console.WriteLine ("1.Chinese.");
        Console.WriteLine ("2.Maths.");
        Console.WriteLine ("3.English.");
        Console.WriteLine ("4.Physical.");
        Console.WriteLine ("-1 is quit.");
        do
        {
            str=Console.ReadLine ();
            i=Int32.Parse (str);
            switch(i)
            {
                case 1:
                    Console.WriteLine ("You like chinese very much.");
                    break;
                case 2:
                    Console.WriteLine ("You like maths very much.");
                    break;
                case 3:
                    Console.WriteLine ("You like english very much.");
                    break;
                case 4:
                    Console.WriteLine ("You like physical very much.");
                    break;
                case -1:
                    break;
                default:
                    Console.WriteLine ("I'm sorry.You can't choose this subject.");
                    break;
            }

        }while(i!=-1);
        Console.WriteLine ("Byebye!");
    }
}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 孟连| 汉寿县| 德阳市| 金阳县| 磴口县| 宁武县| 桂林市| 彭泽县| 洞头县| 裕民县| 白山市| 茶陵县| 白河县| 军事| 宝坻区| 河北省| 自治县| 法库县| 库伦旗| 武胜县| 吉水县| 苍梧县| 监利县| 临西县| 云安县| 黑山县| 沂源县| 德保县| 皮山县| 兖州市| 布拖县| 兴宁市| 荣昌县| 京山县| 郯城县| 婺源县| 汨罗市| 秭归县| 天门市| 贵南县| 灵武市|