ZOJ1149

来源:互联网 发布:sql常用查询语句 编辑:程序博客网 时间:2024/06/09 16:53
#include<stdio.h>#include<stdlib.h>#include<math.h>int main(){int n,i,*p;    double x,y,distance,r;    scanf("%d",&n);    p = (int*)malloc(sizeof(int)*n);    for(i = 0;i<n;i++)    {   scanf("%lf %lf",&x,&y);    distance = sqrt(x*x + y*y);    r = 0;    p[i] = 0;    while(distance>r){    p[i]++;    r = sqrt(50.0*p[i]*2/3.1415);    }    }    for(i = 0;i<n;i++)    {    printf("Property %d: This property will begin eroding in year %d.\n",i + 1,p[i]);    }    printf("END OF OUTPUT.\n");return 0;}

0 0