fork(1) download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. int main() {
  7. double a, b, z, s;
  8. cin >> a >> b >> z;
  9. if ((1/(tan (z * M_PI / 180)) > a/sqrt(2)/b)&&(z != 0) && (z != 90)){
  10. s = a * a / 2 / cos (z * M_PI / 180);
  11. }
  12. else if (z==0) {
  13. s=0;
  14. }
  15. else if (z==90) {
  16. s=a*b*sqrt(2);
  17. }
  18. else {
  19. s=(a*sqrt(2)-b*1/(tan(z* M_PI / 180)))*b/sin(z* M_PI / 180);
  20. }
  21. cout << setprecision(3) << fixed << s;
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 4264KB
stdin
Standard input is empty
stdout
0.000