`
lethorld
  • 浏览: 6731 次
  • 性别: Icon_minigender_1
  • 来自: 上海
最近访客 更多访客>>
社区版块
存档分类
最新评论

P1005 I Think I Need a Houseboat -- 水题

 
阅读更多
#include <stdio.h>
#include <stdlib.h>

double pi = 3.1415926535898;
int main(int argc, char *argv[])
{
	int cnt, i;
	float x, y;
	int year;
	scanf("%d", &cnt);
	for (i=1; i<=cnt; i++) 
	{
		scanf("%f %f", &x, &y);
		double temp = pi * (x*x + y*y) / 100.0;
		year = temp;
		year += (temp - year > 0.0) ? 1 : 0;
		printf("Property %d: This property will begin eroding in year %d.\n", i, year);
	}
	printf("END OF OUTPUT.");
	return 0;
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics