Imran1107048

Triangle

Jun 21st, 2020
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define int long long
  5. #define endl "\n"
  6. #define pb push_back
  7. #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  8. #define IN freopen("input.txt","r",stdin);
  9. #define OUT freopen("output.txt","w",stdout);
  10.  
  11. const int N = 2e5 + 5;
  12. const double pi = acos(-1);
  13.  
  14. int32_t main()
  15. {
  16. IOS;
  17. cout << fixed << setprecision(8);
  18. double a,b,c;
  19. double r=0,area=0,side=0,peri=0,h=0;
  20. cin >> a >> b >> c;
  21.  
  22. r = (c*pi)/180;
  23. area = (a*b*sin(r))/2;
  24. side = sqrt(a*a + b*b - 2*a*b*cos(r));
  25. peri = a+b+side;
  26. h = b*sin(r);
  27.  
  28. cout << area << endl << peri << endl << h << endl;
  29.  
  30. return 0;
  31. }
Add Comment
Please, Sign In to add comment