1. 程式人生 > >已知有列舉型別定義:enum MyEn{a=101,b,c=207,d,e,f,g},程式設計輸出第5個列舉元素的序號值

已知有列舉型別定義:enum MyEn{a=101,b,c=207,d,e,f,g},程式設計輸出第5個列舉元素的序號值

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();
        


        }
    }
}