using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
/*
* 枚举是用来限定变量的取值范围
*/
enum Gender {Male, Female, Unknow};
class Program
{
static void Main(string[] args)
{
Gender male = Gender.Male;
Gender female = Gender.Female;
Gender unknow = Gender.Unknow;
Console.WriteLine(male);
Console.WriteLine(female);
Console.WriteLine(unknow);
Console.ReadKey();
}
}
}
枚举
最新推荐文章于 2024-03-24 12:41:50 发布