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;
- namespace Trapec
- {
- public class Trapec
- {
- public double a;
- public double b;
- public double h;
- public void Input()
- {
- a = double.Parse(Console.ReadLine());
- b = double.Parse(Console.ReadLine());
- h = double.Parse(Console.ReadLine());
- }
- public void Output()
- {
- Console.WriteLine("a: " +a);
- Console.WriteLine("b: " + b);
- Console.WriteLine("h: " + h);
- }
- public Trapec()
- {
- a = 0.0;
- b = 0.0;
- h = 0.0;
- }
- public void S()
- {
- Console.WriteLine("S = "+(a+b)*h/2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement