Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Trapec
  7. {
  8. public class Trapec
  9. {
  10. public double a;
  11. public double b;
  12. public double h;
  13.  
  14. public void Input()
  15. {
  16. a = double.Parse(Console.ReadLine());
  17. b = double.Parse(Console.ReadLine());
  18. h = double.Parse(Console.ReadLine());
  19. }
  20. public void Output()
  21. {
  22. Console.WriteLine("a: " +a);
  23. Console.WriteLine("b: " + b);
  24. Console.WriteLine("h: " + h);
  25. }
  26. public Trapec()
  27. {
  28. a = 0.0;
  29. b = 0.0;
  30. h = 0.0;
  31. }
  32. public void S()
  33. {
  34. Console.WriteLine("S = "+(a+b)*h/2);
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement