Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
/// <summary>
/// 定义枚举类型性别,只有两个值Male和Female
/// </summary>
enum Gender
{
Male,
Female
}
class Program
{
//定义常量PI
const double PI = 3.14;
static void Main(string[] args)
{
Gender sex;
sex = Gender.Male;
switch (sex)
{
case Gender.Male:
Console.Write("是个男的");
break;
case Gender.Female:
Console.Write("是个女的");
break;
}
Console.ReadKey();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment