POJ 1005(累加)

/*
 * POJ_1005.cpp
 *
 *  Created on: 2013年10月14日
 *      Author: Administrator
 */

#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

const double PI = 3.141592653;
int main(){
	int t;
	scanf("%d",&t);
	int counter = 1;
	while(t--){
		double x,y;
		scanf("%lf%lf",&x,&y);

		double r = sqrt(x*x + y*y);

		double target = PI*r*r/2;

		double sum = 0;

		int years = 0;
		while(sum < target){
			sum+=50;

			years++;
		}

		printf("Property %d: This property will begin eroding in year %d.\n",counter++,years);
	}

	printf("END OF OUTPUT.\n");

	return 0 ;

}


posted on 2013-10-16 13:13  我的小人生  阅读(143)  评论(0编辑  收藏  举报