#include <stdio.h>
#include <cmath>
#define pi 3.1415926536
using namespace std;
int main(int argc, char *argv[]) {
int n;
float x, y;
scanf("%d", &n);
float preR2, R2;
int i;
int count = 1;
while (n-- > 0) {
scanf("%f %f", &x, &y);
for (i = 1; ; i++) {
if (i == 1) {
R2 = (100 / pi);
} else {
R2 = (100 / pi + preR2);
}
if (pow(x, 2) + pow(y, 2) < R2) break;
preR2 = R2;
}
printf("Property %d: This property will begin eroding in year %d.\n", count, i);
count++;
}
printf("END OF OUTPUT.\n");
return 0;
}
【POJ】1005. I Think I Need a Houseboat
最新推荐文章于 2023-08-04 09:51:04 发布