Advertisement
StefiIOE

Proverka za triagolnik

Jan 4th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.86 KB | None | 0 0
  1. /******************************************************************************
  2.  
  3.                             Online C Compiler.
  4.                 Code, Compile, Run and Debug C program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. #include <stdio.h>
  10.  
  11. int main()
  12. {
  13.     int a,b,c,tmp;
  14.     scanf("%d%d%d", &a, &b,&c);
  15.    
  16. if ((a+b<=c)||(a+c<=b)||(b+c<=a)){
  17. printf("NO\n");
  18. }
  19. else{
  20. printf("YES\n");
  21.  
  22. if(a>=b){  
  23.    tmp;
  24.     tmp=a;
  25.     a=b;
  26.     b=tmp;
  27.                 }
  28. if (a>=c){
  29. a>=c;
  30. c=tmp;
  31.             }
  32. if(b>=c) {
  33. b=c;
  34. c=tmp;
  35.         }
  36.  
  37. if (c*c==a*a+b*b)
  38. {
  39. printf("Pravoagolen e\n");
  40. float P;
  41. P=(float)a*b/2;
  42. printf("ploshtinata e %.2f\n" ,P);
  43. }
  44. else {
  45. printf("Ne e Pravoagolen\n");
  46. }
  47. }
  48.     return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement