#代碼
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();
? ? ? ? }
? ? }
}
#效果
