fork download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. int main() {
  7. int N;
  8. double S, V, T;
  9. const double g = 10.0;
  10.  
  11. cin >> N >> S >> V >> T;
  12.  
  13. double rad = S * M_PI / 180.0; // konversi derajat ke radian
  14. double H = (V * V * pow(sin(rad), 2)) / (2 * g);
  15.  
  16. for (int i = 1; i <= N; i++) {
  17. int status = (H > T) ? 1 : 0;
  18. cout << status << ":" << fixed << setprecision(2) << H << endl;
  19. }
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 5316KB
stdin
2
37
100
100
37
100
200
stdout
1:181.09
1:181.09