fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. double v0 = 60, theta = 60;
  7. double t = 2 * v0 * sin(theta * M_PI / 180) / 9.8;
  8. cout << fixed;
  9. cout.precision(3);
  10. cout << t << '\n'; // Output: 12.036
  11. }
  12.  
Success #stdin #stdout 0.01s 5316KB
stdin
37
100
stdout
10.604