using System;
class MainClass
{
// 列挙型を定義
enum Sample{Sample1=1,Sample2,Sample5=5,
Sample6,Sample11=Sample1,Sample12}
static void Main()
{
// 出力値:1 2 4 6 1 2
Console.WriteLine("{0} {1} {2} {3} {4} {5}",
(int)Sample.Sample1,(int)Sample.Sample2,
(int)Sample.Sample5,(int)Sample.Sample6,
(int)Sample.Sample11,(int)Sample.Sample12);
}
}
0 コメント:
コメントを投稿