poj 1005(水题,ceil和floor)

#include<iostream>
#include<cmath>
#define PI 3.14159265
using namespace std;
int main(){
    int n;
    double s,x,y,r;
    int count = 0;
    scanf("%d",&n);
    while(++count<=n){
        scanf("%lf%lf",&x,&y);
        r = sqrt(x*x+y*y);
        s = 1.0/2*PI*r*r/50;
        printf("Property %d: This property will begin eroding in year %.0lf.\n",count,ceil(s));
    }
    printf("END OF OUTPUT.\n");
    return 0;
}

 

posted @ 2021-11-05 10:06  智人心  阅读(33)  评论(0)    收藏  举报