开学这么久了,老师都讲完课本7章了,我也该花点时间好好学习下c#了
//枚举类型
// 没有指定时,默认类型为int,默认情况下,第一个枚举元素值为0,后面一次递增,也可以直接赋值
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication3
{
class Program
{
enum color : long { red = 11111, green, blue = 1234566, yellow }; //没有指定了时,默认类型为int
static void Main(string[] args)
{
long a = (long)color.blue;
long b = (long)color.red;
Console.WriteLine("{0}, {1}", a, b);
Console.ReadLine();
}
}
}