赵乐ACM

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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;
}


posted on 2012-03-26 10:55  赵乐ACM  阅读(131)  评论(0编辑  收藏  举报