#代碼
string pass;
? ? ? ? ? ? int count = 0;
? ? ? ? ? ? int amount = 0;
? ? ? ? ? ? string password = "1111111";
? ? ? ? ? ? bool ispass = false;
? ? ? ? ? ? while (!ispass && count < 3)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.WriteLine("請輸入密碼");
? ? ? ? ? ? ? ? pass = Console.ReadLine();
? ? ? ? ? ? ? ? if (password != password)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? count++;
? ? ? ? ? ? ? ? ? ? continue;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? do
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? Console.WriteLine("請輸入金額");
? ? ? ? ? ? ? ? ? ? amount=Convert.ToInt32(Console.ReadLine());
? ? ? ? ? ? ? ? ? ? if(amount>1000||amount%100!=0)
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? continue;
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? else
? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? ? break;
? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? }while(amount>0);
? ? ? ? ? ? ? ? ispass=true;
? ? ? ? ? ? }
? ? ? ? ? ? if(ispass)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.WriteLine("你取了{0}",amount);
? ? ? ? ? ? ? ? Console.WriteLine("交易完成懦窘,請去卡");
? ? ? ? ? ? }
? ? ? ? ? ? Console.ReadKey();