fork download
  1. using System;
  2.  
  3. public class Program {
  4. public static void Main() {}
  5. }
  6.  
  7. public class Pessoa {
  8. public string Nome { get; set; }
  9. public string Endereço { get; set; }
  10. public int Ano_nascimento { get; set; }
  11. public int Idade { get; set; }
  12. public string Telefone { get; set; }
  13. public Pessoa(string nome, string endereço, int ano_nascimento, string telefone) {
  14. Nome = nome;
  15. Endereço = endereço;
  16. Ano_nascimento = ano_nascimento;
  17. Telefone = telefone;
  18. Idade = DateTime.Now.Year - ano_nascimento;
  19. }
  20. }
  21.  
  22. public class Fisica : Pessoa {
  23. public string NmmCPF { get; private set; }
  24. public Fisica(string nome, string endereço, int ano_nascimento, string telefone, string nCPF)
  25. : base(nome, endereço, ano_nascimento, telefone) {
  26. this.NmmCPF = nCPF;
  27. }
  28. }
  29.  
  30. public class Juridica : Pessoa {
  31. public string NumCnpj { get; private set; }
  32. public Juridica(string nome, string endereço, int ano_nascimento, string telefone, string nCNPJ)
  33. : base(nome, endereço, ano_nascimento, telefone) {
  34. NumCnpj = nCNPJ;
  35. }
  36. }
  37.  
  38. //https://pt.stackoverflow.com/q/187631/101
Success #stdin #stdout 0.01s 13856KB
stdin
Standard input is empty
stdout
Standard output is empty