ZOJ1049: houseboat解答。

os posted @ 2013年9月09日 11:54 in ACM , 873 阅读

acm 题目List

http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1049

 

 

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

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter