您的位置:首页 > 其它

poj 1005 I Think I Need a Houseboat

2010-06-06 17:14 405 查看
http://162.105.81.212/JudgeOnline/problem?id=1005

double floor(double x);

double ceil(double x);
floor(x)返回的是小于或等于x的最大整数.
如:

floor(10.5) = 10 floor(-10.5) = -11
ceil(x)返回的是大于或等于x的最小整数.
如:

ceil(10.5) = 11 ceil(-10.5) =-10

#include<stdio.h>
#include<math.h>
int main()
{
int t,id=1;
double x,y,ans,pi=acos(-1.0);;
scanf("%d",&t);
while(t--)
{
scanf("%lf%lf",&x,&y);
ans=pi*(x*x+y*y)/100;
printf("Property %d: This property will begin eroding in year %.0lf./n",id++,ceil(ans));
}
puts("END OF OUTPUT.");
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: