已知有枚举类型定义:enum MyEn{a=101,b,c=207,d,e,f,g},编程输出第5个枚举元素的序号值

论坛 期权论坛 脚本     
匿名技术用户   2020-12-28 02:22   11   0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace _2._3._2
{
enum MyEn { a = 101, b, c = 207, d, e, f, g };
class Program
{

static void Main(string[] args)
{

int x=(int)MyEn.e;
Console.WriteLine("第五个值={0}", x);
Console.Read();



}
}
}
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP