Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Romb
- {
- public double a;
- public double b;
- public double GetS()
- {
- return (a * b) / 2;
- }
- public double GetSt()
- {
- return Math.Sqrt(a*a+b*b)/2;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Romb romb = new Romb();
- Console.Write("Введите первую сторону ромба: ");
- romb.a = Convert.ToDouble(Console.ReadLine());
- Console.Write("Введите вторую сторону ромба: ");
- romb.b = Convert.ToDouble(Console.ReadLine());
- Console.WriteLine("Площадь ромба = " + romb.GetS());
- Console.WriteLine("Сторона ромба = " + romb.GetSt());
- Console.ReadKey();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement