1.刚开始想成是整个圆了,所以一直出错;

2.ceil()函数,第一次用,详见(ceil_百度百科


#include <cmath>
#include <iostream>
using namespace std;
const double PI = 3.1415926;

int main()
{
    double x, y, n;
    cin >> n;
    for(int i = 1; i <= n; i++)
    {
        cin >> x >> y;
        cout << "Property " << i << ": This property will begin eroding in year " << ceil(PI * (x * x + y * y) / 100) << '.' << endl;
    }
    cout << "END OF OUTPUT." << endl;
}


相关文章:

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