namespace Test
{
class Program
{
static void Main(string[] args)
{
int year = 2015;//年份
string text = year % 4 ==0 ? "閏年" : "平年";//請填寫代碼
Console.WriteLine("今年是{0}",text);
}
}
}
{
class Program
{
static void Main(string[] args)
{
int year = 2015;//年份
string text = year % 4 ==0 ? "閏年" : "平年";//請填寫代碼
Console.WriteLine("今年是{0}",text);
}
}
}
2016-05-17
Console.WriteLine(9+"2.2");//輸出92.2,因為"2.2"是字符串,所以9也被轉換為"9",+起的作用是連接字符串
2016-05-16
int year = 2004;
string text;
text = year % 400 == 0 || (year % 4 == 0 &&year%100!=0)? "閏年" : "平年";
Console.WriteLine("今年是{0}", text);
string text;
text = year % 400 == 0 || (year % 4 == 0 &&year%100!=0)? "閏年" : "平年";
Console.WriteLine("今年是{0}", text);
2016-05-14