I Think I Need a Houseboat POJ - 1005

时间:2023-03-09 06:29:18
I Think I Need a Houseboat POJ - 1005

I Think I Need a Houseboat

POJ - 1005

解题思路:水题

#include <iostream>
#include <cstdio>
#include <cmath> using namespace std; int main()
{
int n;
double xx,yy;
double rr;
double area,r;
int year;
scanf("%d",&n);
for(int i=;i<n;i++){
scanf("%lf %lf",&xx,&yy);
rr=sqrt(xx*xx+yy*yy);
year=;
area=;
while(){
year++;
area+=;
r=sqrt(area/3.1415926);
if(r>=rr){
printf("Property %d: This property will begin eroding in year %d.\n",i+,year);
break;
}
}
}
printf("END OF OUTPUT.");
return ;
}