fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. Dog d1;
  8. Dog d2;
  9.  
  10. d1=new Dog("MAA");
  11. d2=new Dog();
  12.  
  13. d1.leg=4;
  14. d2.leg=5;
  15.  
  16. d1.Shout();
  17. d2.Shout();
  18. d1.Run();
  19. d2.Run();
  20. // your code goes here
  21. }
  22. }
  23.  
  24. public class Dog
  25. {
  26. private string mouse;
  27. public int leg;
  28.  
  29. public void Run()
  30. {
  31. Console.WriteLine(leg*100);
  32. }
  33. public void Shout()
  34. {
  35. Console.WriteLine(mouse);
  36. }
  37. public Dog(string a)
  38. {
  39. mouse=a;
  40. }
  41. public Dog()
  42. {
  43. mouse="MONG";
  44. }
  45. }
  46.  
  47.  
Success #stdin #stdout 0.02s 14684KB
stdin
Standard input is empty
stdout
MAA
MONG
400
500