ZOJ 1049 I Think I Need a Houseboat

# 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;
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章