#编码
try
{
for (int i = 0; i < 3; i++)
{
Console.WriteLine("输入密码:");
string str_psaaword = Console.ReadLine();
int password = Convert.ToInt32(str_psaaword);
if (password == 111111)
{
break;
}
}
for (int i = 0; i < 3; i++)
{
Console.WriteLine("取出金额:");
string str_money = Console.ReadLine();
int money = Convert.ToInt32(str_money);
if (money > 1000)
{
Console.WriteLine("输入金额不合法,重新是");
}
else
{
Console.WriteLine("你取出{0}元", money);
break;
}
}
Console.WriteLine("交易成功");
}
catch
{
Console.WriteLine("格式有误");
}
Console.ReadKey();
网友评论