2018-12-27

#代碼

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication3

{

? ? class Program

? ? {

? ? ? ? static void Main(string[] args)

? ? ? ? {

? ? ? ? ? ? bool huida = false;

? ? ? ? ? ? try

? ? ? ? ? ? {

? ? ? ? ? ? ? ? do

? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? Console.WriteLine("*****歡迎進(jìn)入獎客富翁系統(tǒng)*****");

? ? ? ? ? ? ? ? ? ? Console.WriteLine("1注冊");

? ? ? ? ? ? ? ? ? ? Console.WriteLine("2登錄");

? ? ? ? ? ? ? ? ? ? Console.WriteLine("3抽獎");

? ? ? ? ? ? ? ? ? ? Console.WriteLine("******************************");

? ? ? ? ? ? ? ? ? ? Console.WriteLine("請選擇菜單:");

? ? ? ? ? ? ? ? ? ? huida = false;

? ? ? ? ? ? ? ? ? ? int num = Convert.ToInt32(Console.ReadLine());

? ? ? ? ? ? ? ? ? ? switch (num)

? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? case 1:

? ? ? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("[講課富翁系統(tǒng)>注冊]");

? ? ? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("請?zhí)顚憘€人注冊信息:");

? ? ? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("用戶名:");

? ? ? ? ? ? ? ? ? ? ? ? ? ? string a=Console.ReadLine();

? ? ? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("密碼:");

? ? ? ? ? ? ? ? ? ? ? ? ? ? string b=Console.ReadLine();

? ? ? ? ? ? ? ? ? ? ? ? ? ? System.Random Random= new System.Random();

? ? ? ? ? ? ? ? ? ? ? ? ? ? int result = Random.Next(1000, 9999);

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("注冊成功,請記好您的會員卡號");

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("用戶名\t密碼\t會員卡號");

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("{0}\t{1}\t{2}", a, b, result);

? ? ? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ? ? ? ? case 2:

? ? ? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("[講課富翁系統(tǒng)>登錄]");

? ? ? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ? ? ? ? case 3:

? ? ? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("[講課富翁系統(tǒng)>抽獎]");

? ? ? ? ? ? ? ? ? ? ? ? ? ? break;

? ? ? ? ? ? ? ? ? ? ? ? default:

? ? ? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("輸入有誤,程序結(jié)束");

? ? ? ? ? ? ? ? ? ? ? ? ? ? continue;

? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? Console.WriteLine("繼續(xù)嗎(y/n)");

? ? ? ? ? ? ? ? ? ? string huida0 = Console.ReadLine();

? ? ? ? ? ? ? ? ? ? if (huida0 == "y")

? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? huida = true;

? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? ? ? else

? ? ? ? ? ? ? ? ? ? {

? ? ? ? ? ? ? ? ? ? ? ? Console.WriteLine("您選擇退出,程序結(jié)束.");

? ? ? ? ? ? ? ? ? ? ? ? continue;

? ? ? ? ? ? ? ? ? ? }

? ? ? ? ? ? ? ? } while (huida == true);

? ? ? ? ? ? }

? ? ? ? ? ? catch

? ? ? ? ? ? {

? ? ? ? ? ? ? ? Console.WriteLine("您輸入有誤");

? ? ? ? ? ? }

? ? ? ? ? ? Console.ReadKey();

? ? ? ? }

? ? }

}

#效果


?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容