fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. struct Elefante {
  6. int peso;}
  7.  
  8. public class Project1
  9. {
  10. public static void engorda ( Elefante e ) {
  11. e.peso+=100;
  12. }
  13. public static void emagrece ( Elefante e){
  14. e.peso -= 100;
  15. }
  16. public static void desaparece (Elefante e ) {
  17. e. peso = 0;
  18. }
  19.  
  20. static void Main()
  21. {
  22. Elefante dumbo, dumbinho;
  23. dumbo = new Elefante();
  24. dumbinho = new Elefante();
  25. dumbo.peso = 2000;
  26. dumbinho.peso = 200;
  27. engorda(dumbo);
  28. emagrece(dumbinho);
  29. Console.WriteLine(dumbo.peso);
  30. Console.WriteLine(dumbinho.peso);
  31. desaparece(dumbo);
  32. Console.WriteLine(dumbo.peso);
  33. }
  34. }
  35.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(10,24): error CS0051: Inconsistent accessibility: parameter type `Elefante' is less accessible than method `Project1.engorda(Elefante)'
prog.cs(5,8): (Location of the symbol related to previous error)
prog.cs(13,24): error CS0051: Inconsistent accessibility: parameter type `Elefante' is less accessible than method `Project1.emagrece(Elefante)'
prog.cs(5,8): (Location of the symbol related to previous error)
prog.cs(16,24): error CS0051: Inconsistent accessibility: parameter type `Elefante' is less accessible than method `Project1.desaparece(Elefante)'
prog.cs(5,8): (Location of the symbol related to previous error)
Compilation failed: 3 error(s), 0 warnings
stdout
Standard output is empty