fork download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. int main() {
  7. double v0 = 83.8, theta = 45;
  8. double g = 9.8;
  9. double t = 2 * v0 * sin(theta * M_PI / 180) / g;
  10.  
  11. cout << fixed << setprecision(3) << t << '\n'; // Output: 12.036
  12.  
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0.01s 5288KB
stdin
37
100
stdout
12.093