Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 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 ConsoleApplication4
  8. {
  9. public class Coord
  10. {
  11. protected int a, b;
  12. protected double per;
  13. public Coord(string dl)
  14. {
  15.  
  16. a = int.Parse(dl.Split(',')[0]);
  17. b = int.Parse(dl.Split(',')[1]);
  18. }
  19. public bool IsSquare()
  20. {
  21. return (a==b);
  22. }
  23.  
  24. public void Leng()
  25. {
  26. if (IsSquare() == true)
  27. Console.WriteLine("Длины сторон квадрата: {0}", a);
  28. Console.WriteLine("Длины сторон прямоугольника: {0}, {1}", a, b);
  29.  
  30. }
  31. public void Perimetr()
  32. {
  33. per = a+b;
  34. Console.WriteLine("Периметр: " + per);
  35. }
  36. public void Square()
  37. {
  38. Console.WriteLine("Площадь: " + a*b);
  39. }
  40.  
  41.  
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement