I Think I Need a Houseboat POJ - 1005(数学)

时间:2023-03-09 19:14:50
I Think I Need a Houseboat POJ - 1005(数学)

题目大意

在二维坐标内选定一个点,问你当洪水以半圆形扩散且每年扩散50单位,哪一年这个点被被洪水侵蚀?

解法

I Think I Need a Houseboat POJ - 1005(数学)

代码

#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t,cnt=0;
double pi=3.14;
cin>>t;
while(t--)
{
double x,y;
cin>>x>>y;
int t=0.5*pi*(x*x+y*y)/50;
printf("Property %d: This property will begin eroding in year %d.\n",++cnt,t+1);
}
printf("END OF OUTPUT.\n");
}