I Think I Need a Houseboat POJ - 1005

Posted 多一份不为什么的坚持

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

 

以上是关于I Think I Need a Houseboat POJ - 1005的主要内容,如果未能解决你的问题,请参考以下文章

I Think I Need a Houseboat

POJ 1005 I Think I Need a Houseboat

POJ 1005 I Think I Need a Houseboat

POJ 1005 I Think I Need a Houseboat

hdu--1065--I Think I Need a Houseboat

1005 i think i need a houseboat