题目:I Think I Need a Houseboat。
难度:简单,读懂了就可以。
题目意思:
给你个位置坐标 作为你家的位置
从圆心开始 陆地开始腐蚀 以一个半圆的形状开始腐蚀
每年都腐蚀50 square miles 求第几年腐蚀到你家的位置。
代码:
#include<iostream>
using namespace std;
const float PI = 3.1415926;
int main()
{
float x;
float y;
int n,m=1,i;
cin>>n;
while(n--)
{
cin>>x>>y;
for( i = 1; x*x+y*y > 100*i/PI; i++);
cout<<"Property "<<m<<": This property will begin eroding in year "<<i<<"."<<endl;
m++;
}
cout<<"END OF OUTPUT."<<endl;
return 0;
}