码迷,mamicode.com
首页 > 其他好文 > 详细

I Think I Need a Houseboat POJ - 1005

时间:2018-05-30 22:48:10      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:http   double   hide   targe   output   spl   https   str   end   

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

标签:http   double   hide   targe   output   spl   https   str   end   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!