Advertisement
Raul_julian

Triângulo-[OBI]

Jun 17th, 2013
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6.     int A, B, C, A1, B1, C1;
  7.    
  8.     scanf("%d %d %d", &A, &B, &C);
  9.    
  10.     A1=pow(A,2); B1=pow(B,2); C1=pow(C,2);
  11.  
  12.         if((A<0 || A>pow(10,4)) || (B<0 || B>pow(10,4)) || (C<0 || C>pow(10,4))) return 0;  
  13.  
  14.         if((A<B+C && A>B-C) && (B<A+C && B>A-C) && (C<A+B && C>B-A)) {
  15.  
  16.         if((A1==B1+C1) || (B1==A1+C1) || (C1==A1+B1)) printf("r");
  17.         else if(((B1 + C1 - A1)/2*B*C) || ((A1 + C1 - B1)/2*A*C) || ((A1 + B1 - C1)/2*A*B) <        0) printf("o");
  18.         else printf("a"); }
  19.  
  20.         else printf("n");    
  21.  
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement