Advertisement
Guest User

Untitled

a guest
Nov 17th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication3
  8. {
  9. public class Prosta
  10. {
  11. protected int x;
  12.  
  13.  
  14. public Prosta(int xx)
  15. {
  16. x = xx;
  17. }
  18.  
  19. public virtual void odl_zero()
  20. {
  21. Console.WriteLine(Math.Abs(x));
  22. }
  23.  
  24. public class Plaszczyzna : Prosta
  25. {
  26. protected int y;
  27.  
  28. public Plaszczyzna(int xx, int yy)
  29. : base(xx)
  30. {
  31. y = yy;
  32. }
  33.  
  34. public override void odl_zero()
  35.  
  36. {
  37. Console.WriteLine(Math.Sqrt(x * x + y * y));
  38.  
  39. }
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement