首页 > 代码库 > POJ 1005 I Think I Need a Houseboat

POJ 1005 I Think I Need a Houseboat

/*
题意就是由那么一条半圆的湖,面积会以每年50平方英里的速度增大,然后给定一个坐标,求几年后会被淹没
然后稍微乱搞一下,答案就出来了。
*/

#include<iostream>#include<stdio.h>#include<math.h>using namespace std;int main(){ int i,n; double pi,x,y,years; cin>>n; pi=acos(-1);//这个是pi的最准确的表达方式 for(int i=0;i<n;i++) { cin>>x>>y; years=pi*(x*x+y*y)/100; printf("Property %d: This property will begin eroding in year %d.\n",i+1,(int)years+1); } printf("END OF OUTPUT.\n"); return 0;}

 

POJ 1005 I Think I Need a Houseboat