Advertisement
Rofyda_Elghadban1

Untitled

Aug 20th, 2022
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4. #include <algorithm>
  5. #include <cstdlib>
  6. #include <limits.h>
  7. #include <string>
  8.  
  9. #define ll long long
  10.  
  11. using namespace std;
  12. void Fast_IO();
  13. void Rofyda_Elghadban(){
  14. #ifndef ONLINE_JUDGE
  15. freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  16. #endif
  17. }
  18. int main()
  19. { Rofyda_Elghadban();
  20. //Fast_IO();
  21. //freopen("input.txt","r",stdin);
  22. //freopen("output.txt","r",stdout);
  23. int l1,l2,l3;
  24. double num=((l1+l2+l3)/2),area;
  25. cin>>l1>>l2>>l3;
  26. area=sqrt(num*(num-l1)*(num-l2)*(num-l3));
  27. if((l1+l2<=l3)||(l2+l3<=l1)||(l1+l3<=l2)){
  28. cout<<"Invalid"<<endl;
  29. }else{
  30. cout<<"Valid"<<endl;
  31. cout<<area<<endl;
  32. }
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40. return 0;
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement