版本比较
题解:P16466 [GKS 2013 Practice] Captain Hammer
正文
增加 2 行删除 2 行
16 行未改动171819202121222324254 行未改动30313233343435363716 行未改动由于正弦函数值域为 $[-1,1]$,若 $x>1$,则取 $x=1$,保证有解。
## AC code :```cpp# include <bits/stdc++.h>//万能头文件 # include <bits/stdc++.h>//万能头文件using namespace std;int t;double v,d;int main () {4 行未改动 for (int i = 1;i <= t;i++) { cin >> v >> d; double x = d * 9.8 / (v * v); if(x > 1.0) x = 1.0; cout << "Case #" << int(i) << ": " << 0.5 * asin(x) * 180.0 / acos(-1.0) << endl;//直接用公式写 cout << "Case #" << int(i) << ": " << 0.5 * asin(x) * 180.0 / acos(-1.0) << endl;//直接用公式写 } return 0;}