using System; enum Color { Green, Yellow, Red } class MainClass { static void Main() { Color t1 = Color.Green; Color t2 = Color.Yellow; Color t3 = Color.Red; Console.WriteLine("{0},\t{1}", t1, (int)t1); Console.WriteLine("{0},\t{1}", t2, (int)t2); Console.WriteLine("{0},\t{1}\n", t3, (int)t3); } }
Green, 0 Yellow, 1 Red, 2