Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. double a, b, c;
  7. scanf ("%g%g%g", &a, &b, &c);
  8. printf ("a");
  9. if ((a == b) || (a == c))
  10. printf ("isosceles");
  11. if ((a==b) && (a ==c))
  12. printf ("equilateral");
  13. if ((a > b) && (a > c)) {
  14. if ((pow(a,2) == pow(b,2) + pow(c,2)))
  15. printf ("right-angled")
  16. else if (pow(a,2)> pow(b,2) + pow(c,2))
  17. printf ("obtuse-angled"); }
  18. if ((b > a) && (b > c)) {
  19. if ((pow(b,2) == pow(a,2) + pow(c,2)))
  20. printf ("right-angled")
  21. else if ((pow(b,2)> pow(a,2) + pow(c,2)))
  22. printf ("obtuse-angled"); }
  23. if ((c > b) && (c > a)) {
  24. if ((pow(c,2) == pow(b,2) + pow(a,2)))
  25. printf ("right-angled")
  26. else if ((pow(c,2)> pow(b,2) + pow(a,2)))
  27. printf ("obtuse-angled"); }
  28. printf ("triangle");
  29.  
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement