//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错误的原因,通过实例展示了如何正确地进行转换操作,并提供了解决方案。
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
Langchain-Chatchat
AI应用
Langchain
Langchain-Chatchat 是一个基于 ChatGLM 等大语言模型和 Langchain 应用框架实现的开源项目,旨在构建一个可以离线部署的本地知识库问答系统。它通过检索增强生成 (RAG) 的方法,让用户能够以自然语言与本地文件、数据库或搜索引擎进行交互,并支持多种大模型和向量数据库的集成,以及提供 WebUI 和 API 服务
957

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



