I Think I Need a Houseboat POJ - 1005

I Think I Need a Houseboat

 POJ - 1005

解题思路:水题

#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

int main()
{
    int n;
    double xx,yy;
    double rr;
    double area,r;
    int year;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%lf %lf",&xx,&yy);
        rr=sqrt(xx*xx+yy*yy);
        year=0;
        area=0;
        while(1){
            year++;
            area+=100;
            r=sqrt(area/3.1415926);
            if(r>=rr){
                printf("Property %d: This property will begin eroding in year %d.\n",i+1,year);
                break;
            }
        }
    }
    printf("END OF OUTPUT.");
    return 0;
}
View Code

 

全部评论

相关推荐

10-05 23:02
东北大学 Java
我说句实话啊:那时候看三个月培训班视频,随便做个项目背点八股,都能说3 40w是侮辱价
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务