Guest User

Untitled

a guest
Apr 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main (){
  5. int A, B, C, D;
  6. char res;
  7.  
  8. printf("Insira quantro numeros entre 1 e 100 separados por espaco: \t");
  9. scanf("%i %i %i %i", &A,&B,&C,&D);
  10.  
  11. if ( (A<1) || (A>100) || (B<1) || (B>100) || (C<1) || (C>100) || (D<1) || (D>100) ){
  12.  
  13. printf("\n\n\tVALORES N COMPREENDIDOES ENTRE 1 E 100\n\n");
  14.  
  15. } else {
  16.  
  17. //A+B+C;
  18.  
  19. if (((abs(B-C))<A && A<(B+C)) || ((abs(A-C))<B && B<(A+C)) || ((abs(A-B))<C && C<(A+B))){
  20.  
  21. res='S';
  22.  
  23. }
  24.  
  25. //A+C+D;
  26.  
  27. else if (((abs(C-D))<A && A<(C+D)) || ((abs(A-D))<C && C<(A+D)) || ((abs(A-C))<D && D<(A+C))){
  28.  
  29. res='S';
  30.  
  31. }
  32.  
  33. //A+B+D;
  34.  
  35. else if (((abs(B-D))<A && A<(B+D)) || ((abs(A-D))<B && B<(A+D)) || ((abs(A-B))<D && D<(A+B))){
  36.  
  37. res='S';
  38.  
  39. }
  40.  
  41. //B+C+D;
  42.  
  43. else if (((abs(C-D))<B && B<(C+D)) || ((abs(B-D))<C && C<(B+D)) || ((abs(B-C))<D && D<(B+C))){
  44.  
  45. res='S';
  46.  
  47. } else {
  48.  
  49. res='N';
  50.  
  51. }
  52.  
  53. printf("\n\n\t %c \n\n",res);
  54.  
  55. }
  56.  
  57. return 0;
  58.  
  59. }
Add Comment
Please, Sign In to add comment