Advertisement
wojiaocbj

Untitled

Mar 22nd, 2023
761
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.73 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. #include <ctype.h>
  5. #include <string.h>
  6. #include <time.h>
  7. int main(){
  8.     int a, b, c;
  9.     scanf("%d%d%d", &a, &b, &c);
  10.     if(((a + b) > c) && ((a + c) > b) && ((b + c) > a)){
  11.         if((a * a == (b * b + c * c)) || (b * b == (a * a + c * c)) || (c * c == (a * a + b * b))){
  12.             puts("right triangle");
  13.         }
  14.         else if((a * a > (b * b + c * c)) || (b * b > (a * a + c * c)) || (c * c > (a * a + b * b))){
  15.             puts("obtuse triangle");
  16.         }
  17.         else{
  18.             puts("acute triangle");
  19.         }
  20.  
  21.         if((a == b) && (b == c)){
  22.             puts("equilateral triangle");
  23.         }
  24.         else if((a == b) || (b == c) || (a == c)){
  25.             puts("isosceles triangle");
  26.         }
  27.  
  28.     }
  29.     else{
  30.         puts("no triangle");
  31.     }
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement