fork download
  1. using static System.Console;
  2. using System.Collections.Generic;
  3.  
  4. public class Program {
  5. public static void Main() {
  6. Pessoa.Lista();
  7. }
  8. }
  9.  
  10. public class Pessoa {
  11. public int ID { get; set; }
  12. public string Nome1 { get; set; }
  13. public string Nome2 { get; set; }
  14. public static List<Pessoa> Pessoas { get; set; } = new List<Pessoa>();
  15. public static void Lista() {
  16. for (var i = 0; i < Pessoas.Count; i++) WriteLine(Pessoas[i].Nome1 + (i + 1).ToString());
  17. }
  18. }
  19.  
  20. //https://pt.stackoverflow.com/q/348156/101
Success #stdin #stdout 0.01s 14228KB
stdin
Standard input is empty
stdout
Standard output is empty