在二维坐标内选定一个点,问你当洪水以半圆形扩散且每年扩散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");
}

相关文章:

  • 2022-02-02
  • 2021-04-19
  • 2021-11-08
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
  • 2022-12-23
猜你喜欢
  • 2021-10-20
  • 2021-09-18
  • 2022-03-09
  • 2021-11-12
  • 2021-10-31
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案