Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int a, b, c;
  7. cin >> a;
  8. cin >> b;
  9. cin >> c;
  10. if (a+b+c > 180 || (a==0) || (b==0)|| (c==0)) {
  11. cout <<" Not a triangle";
  12. }
  13. else {
  14. if (a + b + c == 180) {
  15. if (a == b && b == c) {
  16. cout << "Equilateral triangle" << endl;
  17. }
  18. else {
  19. if ((a && b == 45) || (a && c == 45) || (b && c == 45)) {
  20. cout << "Rectangular isosceles triangle" << endl;
  21. } else {
  22. if ((a + b == 90) || (a + c == 90) || (b + c == 90) || (a == 90) || (b == 90) || (c == 90)) {
  23. cout << "Rectangular triangle" << endl;
  24. }
  25. else {
  26. if ((a == b) || (a == c) || (b == c)) {
  27. cout << "Isosceles triangle" << endl;
  28. }
  29. else{
  30. cout << "common triangle";
  31. }
  32. }
  33. }
  34. }
  35.  
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement