int year = 2015;//年份
string text;
text=(year%4)==0?"潤年":"平年";//請填寫代碼
Console.WriteLine("今年是{0}",text);
int year = 2015;//年份
還有一種方法
string text;
if(year%4==0)
text="閏年";
else
text="平年";
Console.WriteLine("今年是{0}",text);
string text;
text=(year%4)==0?"潤年":"平年";//請填寫代碼
Console.WriteLine("今年是{0}",text);
int year = 2015;//年份
還有一種方法
string text;
if(year%4==0)
text="閏年";
else
text="平年";
Console.WriteLine("今年是{0}",text);
2017-05-23
switch (job)
{
case "局長": Console.Write("發雙黃月餅"); break;
case "處長": Console.Write("發蛋黃月餅"); break;
case"科長": Console.Write("發棗泥月餅"); break;
case "小明": Console.Write("發蛋黃月餅"); break;
}
{
case "局長": Console.Write("發雙黃月餅"); break;
case "處長": Console.Write("發蛋黃月餅"); break;
case"科長": Console.Write("發棗泥月餅"); break;
case "小明": Console.Write("發蛋黃月餅"); break;
}
2017-05-23
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <=y; x++)
{
Console.Write(x);
}
Console.WriteLine();//換行
{
for (int x = 1; x <=y; x++)
{
Console.Write(x);
}
Console.WriteLine();//換行
2017-05-21
for (int y = 1; y <= 7; y++)
{
for (int x = 1; x <=y; x++)
{
Console.Write(x);
}
Console.WriteLine();//換行
{
for (int x = 1; x <=y; x++)
{
Console.Write(x);
}
Console.WriteLine();//換行
2017-05-21
if(salary>price)//請在這里補充條件判斷
{
Console.WriteLine("這月工資夠買手機!");
}
else
{
Console.WriteLine("這月工資不夠買手機!");
}
}
}
{
Console.WriteLine("這月工資夠買手機!");
}
else
{
Console.WriteLine("這月工資不夠買手機!");
}
}
}