zoj-1049

来源:互联网 发布:网络钮祜禄是什么梗 编辑:程序博客网 时间:2024/05/16 09:03
#include<iostream>#include<cmath>#include<cstdio>using namespace std;#define PI 2*acos(0.0)int main(){    int n,cnt=1,year;    cin>>n;    double x,y,r,area;    while(n--)    {        cin>>x>>y;        r=x*x+y*y;        area=PI*r/2.0;        year=(int)ceil(area/50.0);//ceil(doube x)得到大于x的最小整数        cout<<"Property "<<cnt++<<": ";//有空格        cout<<"This property will begin eroding in year "<<year<<"."<<endl;    }    cout<<"END OF OUTPUT."<<endl;//少了这句    return 0;}

原创粉丝点击