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

浙公网安备 33010602011771号