//WA了很多次,百度了一下,才知道原来是小数与整数之间的错误,还不够细心!
#include "iostream"
#include "string"
using namespace std;
const int pi = 3.14159;
int main()
{
string tag1, tag2;
double X, Y, Z, distance, abledistance, remain;
while (cin >> tag1)
{
if (tag1 == "ENDOFINPUT")
break;
cin >> X >> Y >> Z;
cin >> tag2;
distance = abledistance = remain = 0;
if (Z > 180)
Z = 360 - Z;
distance = 2 * 2 * X * pi * Z / 360;
abledistance = 5 * Y;
if (abledistance >= distance)
{
remain = Y - distance / 5;
cout << "YES " << (int)remain << endl;
}
else
{
cout << "NO " <<(int) abledistance << endl;
}
}
}zoj 1394 Polar Explorer
最新推荐文章于 2025-12-03 19:05:38 发布
本文探讨了在编程中处理小数与整数转换时常见的问题,特别是WA错误的原因,通过实例展示了如何正确地进行转换操作,并提供了解决方案。
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
HunyuanVideo-Foley
语音合成
HunyuanVideo-Foley是由腾讯混元2025年8月28日宣布开源端到端视频音效生成模型,用户只需输入视频和文字,就能为视频匹配电影级音效
957

被折叠的 条评论
为什么被折叠?



