只说明一点,枚举类型实际上和int型是对应的,我们看一个例子
using System;
using System.Collections.Generic;
using System.Text;
namespace 枚举
{
class Program
{
static void Main(string[] args)
{
int i = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(((date)i));
}
enum date
{
Sunday, Monday, Tuesday, Wendesday, Thrusday, Friday, Saturday
}
}
}
using System.Collections.Generic;
using System.Text;
namespace 枚举
{
class Program
{
static void Main(string[] args)
{
int i = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(((date)i));
}
enum date
{
Sunday, Monday, Tuesday, Wendesday, Thrusday, Friday, Saturday
}
}
}
肩负责任,永不退缩