Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication4
- {
- public class Coord
- {
- protected int a, b;
- protected double per;
- public Coord(string dl)
- {
- a = int.Parse(dl.Split(',')[0]);
- b = int.Parse(dl.Split(',')[1]);
- }
- public bool IsSquare()
- {
- return (a==b);
- }
- public void Leng()
- {
- if (IsSquare() == true)
- Console.WriteLine("Длины сторон квадрата: {0}", a);
- Console.WriteLine("Длины сторон прямоугольника: {0}, {1}", a, b);
- }
- public void Perimetr()
- {
- per = a+b;
- Console.WriteLine("Периметр: " + per);
- }
- public void Square()
- {
- Console.WriteLine("Площадь: " + a*b);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement