> 其他 >
C# 基础语言 if..else
string tax;
decimal taxa;
Console.WriteLine("Enter tax Y or N");
Input = Console.ReadLine();
tax = Convert.ToString(Input);
if (tax == Y);
{
taxa=0.01;
}
else(tax == N);
{
taxa=0;
}
Console.WriteLine(taxa)
题要求
输入Y 显示 10
输入N 显示 0
我好像写的不对,应该如何改呢
人气:204 ℃ 时间:2020-03-17 22:36:24
解答
static void Main(string[] args){string tax;decimal taxa;Console.WriteLine("Enter tax Y or N");tax = Console.ReadLine().ToString();if...
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版