poj1005 I Think I Need a Houseboat

时间:2022-08-25 19:57:16

这题目只要读懂了意思就好做了,先求出来(0.0)到(x.y)的距离为r,然后求出来以r为半径的半圆的面积,然后再用这个面积除以50,再向上取整就可以啦。

 #include <stdio.h>
#include <math.h>
#include <stdlib.h>
#define eps 0.000000001
#define pie 3.1415926
int main(){
int t;
double res;
double area;
double r;
double x,y;
int cnt=;
scanf("%d",&t);
while(t--){
scanf("%lf%lf",&x,&y);
r=sqrt( x*x+y*y );
area=(pie*r*r)/;
res=area/50.0;
printf("Property %d: This property will begin eroding in year %d.\n",cnt++,(int)ceil(res));
}
printf("END OF OUTPUT.\n");
return ;
}