fork download
  1. using System;
  2. using static System.Console;
  3. using System.Collections.Generic;
  4.  
  5. public class Program {
  6. public static void Main() {
  7. var lista = new List<int>();
  8. foreach (int item in Enum.GetValues(typeof(TiposHospedagem))) lista.Add(item);
  9. foreach (var item in lista) WriteLine(item);
  10. }
  11. }
  12.  
  13. public enum TiposHospedagem {
  14. Casa = 1,
  15. Hotel = 2,
  16. Pousada = 3,
  17. CasaCampo = 4
  18. }
  19.  
  20. //https://pt.stackoverflow.com/q/150208/101
Success #stdin #stdout 0.02s 16204KB
stdin
Standard input is empty
stdout
1
2
3
4