首页 > 其他 > 详细

poj1005

时间:2017-05-07 19:09:02      阅读:237      评论:0      收藏:0      [点我收藏+]

  

/* X轴上方为陆地下方为水
水每年让陆地收缩50平方英里
输入第一行为数据组数
其余为X,Y坐标
判断水多少年能冲击到座标上*/

#include<iostream>
#include<math.h>
using namespace std;
#define PL 3.1415926
int main()
{
double x, y, r, d;
int n,z;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>x;
cin>>y;
d=sqrt(x*x+y*y);
z=PL*d*d*0.01+1;//赋值的时候只把整数放进去小数没存进去   
cout<<"Property "<<i<<": This property will begin eroding in year " <<z<<"."<<endl;
}

cout<<"END OF OUTPUT."<<endl;
return 0;
}

poj1005

原文:http://www.cnblogs.com/mykonons/p/6821801.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!