switch (job)
{
case "局長": Console.Write("發雙黃月餅"); break;
case "處長": Console.Write("發蛋黃月餅"); break;
case "科長": Console.Write("發棗泥月餅"); break;
default: Console.Write("發五仁月餅"); break;
}
{
case "局長": Console.Write("發雙黃月餅"); break;
case "處長": Console.Write("發蛋黃月餅"); break;
case "科長": Console.Write("發棗泥月餅"); break;
default: Console.Write("發五仁月餅"); break;
}
2016-10-27
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
string nima;//聲明變量保存愛好
nima="你媽";//給愛好變量賦值
Console.WriteLine("我愛好"+nima);//打印變量
}
}
}
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
string nima;//聲明變量保存愛好
nima="你媽";//給愛好變量賦值
Console.WriteLine("我愛好"+nima);//打印變量
}
}
}
namespace Test
{
class Program
{
static void Main(string[] args)
{
const string XB = "女人";//常量,性別
const string Mingzi = "璐璐";//常量,姓名
Console.WriteLine(Mingzi+"是個"+XB+"的典范");//使用常量
}
}
}
{
class Program
{
static void Main(string[] args)
{
const string XB = "女人";//常量,性別
const string Mingzi = "璐璐";//常量,姓名
Console.WriteLine(Mingzi+"是個"+XB+"的典范");//使用常量
}
}
}
string[] job =new string[] {"經理","項目主管","技術總監","財務主管"};
for (int i = 0; i < job.Length ; i++)
{
Console.Write(job[i]);//打印職位
}
Console.Write(job[i]);//打印職位是個坑
for (int i = 0; i < job.Length ; i++)
{
Console.Write(job[i]);//打印職位
}
Console.Write(job[i]);//打印職位是個坑
2016-10-25
string[] job =new string[] {"經理","項目主管","技術總監","財務主管"};
for (int i = 0; i < job.Length ; i++)
{
Console.WriteLine(job[i]);//打印職位
for (int i = 0; i < job.Length ; i++)
{
Console.WriteLine(job[i]);//打印職位
2016-10-25
if (x >= y)
{
if (x >= 5)
Console.WriteLine("5");
}
else
{
if (y >= 6)
Console.WriteLine("6");
else
Console.WriteLine("7");
}
{
if (x >= 5)
Console.WriteLine("5");
}
else
{
if (y >= 6)
Console.WriteLine("6");
else
Console.WriteLine("7");
}
2016-10-25
else if (job == "處長")
{
Console.WriteLine("發蛋黃月餅");
}
else if(job == "科長")//請輸入
{
Console.WriteLine("發棗泥月餅");
}
else //請輸入
{
Console.WriteLine("發五仁月餅");
}
{
Console.WriteLine("發蛋黃月餅");
}
else if(job == "科長")//請輸入
{
Console.WriteLine("發棗泥月餅");
}
else //請輸入
{
Console.WriteLine("發五仁月餅");
}
2016-10-25
char sex='男';//性別
int age = 21;//年齡
if(sex!='男')//請填寫條件
{
if (age >= 20)
int age = 21;//年齡
if(sex!='男')//請填寫條件
{
if (age >= 20)
2016-10-25
double price = 4388;//手機的售價
double salary = 4978.67;//本月實發工資
if(salary>=price)//請在這里補充條件判斷
{
Console.WriteLine("這月工資夠買手機!");
}
else
{
Console.WriteLine("這月工資不夠買手機!");
}
double salary = 4978.67;//本月實發工資
if(salary>=price)//請在這里補充條件判斷
{
Console.WriteLine("這月工資夠買手機!");
}
else
{
Console.WriteLine("這月工資不夠買手機!");
}