清泉逐流

做着努力,等待幸福到来

Poj1005

作者:Eamonn 时间 : 2014-09-09 20:10 分类:C/C++

#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
using namespace std;
int main(int argc, char* argv[])
{
       
    int count; 
    cin >> count;
       
    for(int cnt=0; cnt<count; cnt++){
       
        double x,y,s;
           
        cin >> x >> y;
        s = M_PI * (x*x + y*y);
           
        int year = 1;
        for(;;year++){
            if( year*100.0F > s ){
                break;
            }
        }
           
        cout << "Property "<< cnt+1 << ": This property will begin eroding in year " << year << "." << endl;
           
    }
       
    cout << "END OF OUTPUT." << endl;
       
    return 0;
}


转载注明: http://www.eamonning.com/note/view/32
» 笔记大类