Double money =0;
string xiangmu="";
double sale =0;
Console.WriteLine("<迷你游戏厅>游戏币支付");
Console.WriteLine("请选择游戏类型:");
Console.WriteLine("1、牌类");
Console.WriteLine("2、休闲竞技类");
int n =Convert .ToInt32 ( Console.ReadLine());
Console.WriteLine("请输入你的游戏时长:");
Double t =Convert .ToDouble ( Console.ReadLine());
switch (n)
{
case 1:
xiangmu = "牌类";
break;
case 2:
xiangmu = "休闲竞技类";
break;
}
if(n==1)
{ if (t <10)
{ sale=0.8;
}
else
{ sale=0.5;
}
money=t*sale*10;
}
else
{if(t<10)
{sale=0.8;
}
else{sale=0.5;
}
money=t*sale*20;
}
Console.WriteLine("你玩的是第{0}类游戏,时长为{1},享受{2}折优惠",n,t,sale);
Console.WriteLine("你支付{0}个游戏币",money);
Console .ReadKey ();
网友评论