# include <stdio.h>
# include <math.h>
const double PI = 3.1415927;
int main()
{
int n, i = 1;
int year;
double x, y, radius, area;
scanf("%d", &n);
while(n--)
{
scanf("%lf%lf", &x, &y);
radius = x * x + y * y;
area = PI * radius / 2.0;
year = (int)ceil(area / 50.0);
printf("Property %d: ", i++);
printf("This property will begin eroding in year %d.\n", year);
}
printf("END OF OUTPUT.\n");
return 0;
}
ZOJ 1049 I Think I Need a Houseboat
最新推荐文章于 2017-10-25 20:19:31 发布
本文分享了一段C语言程序代码,该程序用于计算给定坐标下土地开始遭受侵蚀的具体年份。通过输入坐标的x和y轴值,程序会计算出土地面积,并基于固定比率估算出土地开始侵蚀的时间。
268

被折叠的 条评论
为什么被折叠?



