1065 i think i need a houseboat.cpp

来自「威士忌的HDU题解.大概有260多题的源码。对于学习非常有好处。」· C++ 代码 · 共 36 行

CPP
36
字号
/*
1065 I Think I Need a Houseboat
Time Limit : 1000 ms  Memory Limit : 32768 K  Output Limit : 1024 K

GUN C++
*/
#include <iostream.h>
#include <math.h>
using namespace std;

const int Max=1000;
const float Pi=3.1415926;

int main()
{
    int n,ca,z,land;
    float x,y,r,len;
    cin>>n;
    for(ca=1;ca<=n;ca++)
    {
        cin>>x>>y;
        len=sqrt(x*x+y*y);
        r=0;z=0;land=0;
        while(len>r)
        {
            land+=50;
            r=sqrt(2*land/Pi);
            z++;
        }
        cout<<"Property "<<ca<<": This property will begin eroding in year "<<z<<".\n";
    }
    cout<<"END OF OUTPUT.\n";
    return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?