Advertisement
veronikaaa86

Trapezoid Area C#

Oct 17th, 2017
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 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 TrapezoidArea
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.         var b1 = double.Parse(Console.ReadLine());
  14.             var b2 = double.Parse(Console.ReadLine());
  15.             var h = double.Parse(Console.ReadLine());
  16.             double sum = (b1 + b2) * h / 2;
  17.             Console.WriteLine("Trapezoid area = " + sum);
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement