首页 > 其他 > 详细

I Think I Need a Houseboat POJ - 1005

时间:2018-05-30 21:55:23      阅读:171      评论:0      收藏:0      [点我收藏+]

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

原文:https://www.cnblogs.com/TWS-YIFEI/p/9113706.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!