Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. TAD Triangulo
  2.  
  3. Interface exportado Triangulo
  4.  
  5. function CalcularSuperficie(t:triangulo):integer;
  6. function CantidadDeLadosIguales(t:triangulo):integer;
  7.  
  8. Implementation
  9.  
  10. triangulo = record
  11. base:integer;
  12. altura:integer;
  13. angulos = array [1..3] of integer;
  14. end;
  15.  
  16. function CalcularSuperficie(t:triangulo):integer;
  17. begin
  18. CalcularSuperficie:=(t^.base*t^.altura)/2;
  19. end;
  20.  
  21. function CantidadDeLadosIguales(t:triangulo):integer;
  22. var cant:integer;
  23. begin
  24. cant:=1;
  25. if(t^.angulos[1] = t^.angulos[2]) and (t^.angulos[2] = t^.angulos[3])
  26. cant:=3
  27. else if (t^.angulo[1] = t^.angulo[2]) or (t^.angulo[2] = t^.angulo[3] or (t^.angulo[1] = t^.angulo[3]) then
  28. cant:=2;
  29. CantidadDeLadosIguales:=cant;
  30. end;
  31.  
  32. program Ejercicio1;
  33.  
  34. uses Triangulo
  35.  
  36. type
  37.  
  38. triangulos = array[1..10] of triangulo;
  39.  
  40. var
  41. base,altura,angulo1,angulo2,angulo3:integer;
  42.  
  43. begin
  44. writeln('Ingrese los parametros del triangulo:');
  45.  
  46. readln(base,altura,angulo1,angulo2,angulo3);
  47.  
  48. for i:=1 to 10 do
  49. begin
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement