来源http://acm.hdu.edu.cn/showproblem.php?pid=1065
提交了五次才过。。。。
最后的解法和第一次的解法完全一样,结果ac了。。。
#include<stdio.h>
#include<math.h>
using namespace std;
#define pi 3.1415926
int main()
{
double x,y,d,r;
int t,i,t1=1;
scanf("%d",&t);
while(t--)
{
scanf("%lf%lf",&x,&y);
d=(x*x+y*y)*pi/2;
i=int(d/50)+1;
printf("Property %d: This property will begin eroding in year %d.\n",t1++,i);
}
printf("END OF OUTPUT.\n");
return 0;
}
本文提供了一道来自HDU在线评测系统的题目解决方案,通过使用C++编程语言实现,该代码经过多次调试最终成功通过评测。文章详细展示了如何计算特定条件下属性开始侵蚀的年份。
1406

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



