突然发现1005竟然忘记写题解了。。补上
这道题当时有点没看懂,后来看了discuss才明白意思的,
大体意思是这样的:有一个半圆从原点每年以一定的速度扩张,然后给你一些点,要求你输出半圆扩张到这些点的时间(多少年)。。
然后用数学公式就过了。。
#include <cstdio>
#define pi 3.14159265357
int main(int argc, char const *argv[])
{
freopen("input", "r", stdin);
freopen("output", "w", stdout);
int n, i = 0;
for(scanf("%d", &n); i < n; ++i){
double x, y;
scanf("%lf%lf", &x, &y);
double r = x*x + y*y;
double s = pi*r;
double tmp = 0;
while(++tmp*100 < s) ;
printf("Property %d: This property will begin eroding in year %.0f.\n", i+1, tmp);
}
printf("END OF OUTPUT.");
return 0;
}