I Think I Need a Houseboat POJ

题目大意

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

解法

代码

#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.
",++cnt,t+1);
  }
  printf("END OF OUTPUT.
");
}
原文地址:https://www.cnblogs.com/baccano-acmer/p/10107183.html