fork download
  1. using System;
  2. using System.Linq;
  3.  
  4. public class Test
  5. {
  6. enum Hoge
  7. {
  8. Hoge0 = 0,
  9. Hoge1,
  10. Hoge100 = 100,
  11. }
  12.  
  13. public static void Main()
  14. {
  15. var hogeArray = Enum.GetValues(typeof(Hoge)).Cast<Hoge>();
  16. foreach (var h in hogeArray)
  17. {
  18. Console.WriteLine(string.Format("{0} = {1}", h, (int)h));
  19. }
  20. }
  21. }
Success #stdin #stdout 0.05s 33976KB
stdin
Standard input is empty
stdout
Hoge0 = 0
Hoge1 = 1
Hoge100 = 100