#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
int n,i,*p;
double x,y,distance,r;
scanf("%d",&n);
p = (int*)malloc(sizeof(int)*n);
for(i = 0;i<n;i++)
{ scanf("%lf %lf",&x,&y);
distance = sqrt(x*x + y*y);
r = 0;
p[i] = 0;
while(distance>r){
p[i]++;
r = sqrt(50.0*p[i]*2/3.1415);
}
}
for(i = 0;i<n;i++)
{
printf("Property %d: This property will begin eroding in year %d.\n",i + 1,p[i]);
}
printf("END OF OUTPUT.\n");
return 0;
}
ZOJ1149
最新推荐文章于 2022-05-03 19:30:00 发布
本文介绍了一个使用 C 语言编写的程序,该程序通过输入坐标和特定公式计算属性开始受到侵蚀的年份。用户需要提供点的数量及各点的坐标,程序会计算每个点相对于原点的距离,并基于此距离确定侵蚀开始的年份。

500

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



