C# 基础语言 if..else

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
我好像写的不对,应该如何改呢
其他人气:596 ℃时间: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...
我来回答
类似推荐
请使用1024x768 IE6.0或更高版本浏览器浏览本站点,以保证最佳阅读效果。本页提供作业小助手,一起搜作业以及作业好帮手最新版!
版权所有 CopyRight © 2012-2024 作业小助手 All Rights Reserved. 手机版