poj 1005 I Think I Need a Houseboat

点击打开链接

大体意思:半圆表示一块面积可扩展的区域,开始时,面积是0,在(0,0)处开始以每年50平方米的速度同样呈半圆扩展,输入一个正整数N,然后输入N对坐标,对于每一对坐标值:求出面积扩展到该点的年数,坐标值单位为米。

#include"stdio.h"
#include"math.h"
#define PI 3.1415926
int main()
{
	int t,i;
	__int64 ans;
	double x,y,tal;
	scanf("%d",&t);
	i=0;
	while(t--)
	{
		i++;
		scanf("%lf%lf",&x,&y);
		tal=(x*x+y*y)*PI/100+1;
		ans=tal+1e-6;
		printf("Property %d: This property will begin eroding in year %I64d.\n",i,ans);
		if(t==0)printf("END OF OUTPUT.\n");
	}
	return 0;
}


原文地址:https://www.cnblogs.com/yyf573462811/p/6365303.html