1005:I Think I Need a Houseboat

总时间限制: 
1000ms

内存限制: 
65536kB
描述
Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he learned that the state of Louisiana is actually shrinking by 50 square miles each year, due to erosion caused by the Mississippi River. Since Fred is hoping to live in this house the rest of his life, he needs to know if his land is going to be lost to erosion.

After doing more research, Fred has learned that the land that is being lost forms a semicircle. This semicircle is part of a circle centered at (0,0), with the line that bisects the circle being the X axis. Locations below the X axis are in the water. The semicircle has an area of 0 at the beginning of year 1. (Semicircle illustrated in the Figure.)

输入
The first line of input will be a positive integer indicating how many data sets will be included (N). Each of the next N lines will contain the X and Y Cartesian coordinates of the land Fred is considering. These will be floating point numbers measured in miles. The Y coordinate will be non-negative. (0,0) will not be given.
输出
For each data set, a single line of output should appear. This line should take the form of: “Property N: This property will begin eroding in year Z.” Where N is the data set (counting from 1), and Z is the first year (start from 1) this property will be within the semicircle AT THE END OF YEAR Z. Z must be an integer. After the last data set, this should print out “END OF OUTPUT.”
样例输入
2
1.0 1.0
25.0 0.0
样例输出
Property 1: This property will begin eroding in year 1.
Property 2: This property will begin eroding in year 20.
END OF OUTPUT.
提示
1.No property will appear exactly on the semicircle boundary: it will either be inside or outside. 
2.This problem will be judged automatically. Your answer must match exactly, including the capitalization, punctuation, and white-space. This includes the periods at the ends of the lines.
3.All locations are given in miles.
简单计算;
代码:
#include<iostream>
#include<stdio.h>
#include<string.h>
#include <stdlib.h>
#include<vector>
#include<queue>
#include<math.h>
using namespace std;
#define PI 3.141592653
int main()
{
int number;
int i,j;
int sum;
double s_x,s_y;
cin>>number;
for(i=;i<=number;i++)
{ int year_count=;
double area,radius;
cin>>s_x>>s_y;
if(s_x==&s_y==)
{
break;
}
radius=sqrt((s_x*s_x)+(s_y*s_y));
area=(PI*radius*radius)/2.0;
while(area>=)
{
area=area-;
year_count++;
}
printf("Property %d: This property will begin eroding in year %d.\n",i,year_count);
}
printf("END OF OUTPUT.\n"); }

1005:I Think I Need a Houseboat-poj的更多相关文章

  1. I Think I Need a Houseboat POJ - 1005

    I Think I Need a Houseboat POJ - 1005 解题思路:水题 #include <iostream> #include <cstdio> #inc ...

  2. POJ. 1005 I Think I Need a Houseboat(水 )

    POJ. 1005 I Think I Need a Houseboat(水 ) 代码总览 #include <cstdio> #include <cstring> #incl ...

  3. OpenJudge/Poj 1005 I Think I Need a Houseboat

    1.链接地址: http://bailian.openjudge.cn/practice/1005/ http://poj.org/problem?id=1005 2.题目: I Think I Ne ...

  4. [POJ 1005] I Think I Need a Houseboat C++解题

        I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 81874   ...

  5. poj 1005:I Think I Need a Houseboat(水题,模拟)

    I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 85149   Acce ...

  6. [POJ] #1005# I Think I Need a Houseboat : 浮点数运算

    一. 题目 I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 97512 ...

  7. poj 1005 I Think I Need a Houseboat

    #include <iostream> using namespace std; const double pi = 3.1415926535; int main() { ;; doubl ...

  8. I Think I Need a Houseboat POJ - 1005(数学)

    题目大意 在二维坐标内选定一个点,问你当洪水以半圆形扩散且每年扩散50单位,哪一年这个点被被洪水侵蚀? 解法 代码 #include <iostream> #include <cst ...

  9. 1005 -- I Think I Need a Houseboat

    I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 105186   Acc ...

  10. 百炼OJ - 1005 - I Think I Need a Houseboat

    题目链接:http://bailian.openjudge.cn/practice/1005/ 思路 一个半圆面积每年增长50,已知一个点坐标,求第几年点在半圆内. #include <stdi ...

随机推荐

  1. PHP中header的作用

    1.跳转: //若等待时间为0,则与header("location:")等效.  //Header("Location:http://localhost//sessio ...

  2. 基于HTML5及WebGL开发的2D3D第一人称漫游进行碰撞检测

    为了实现一个基于HTML5的场景小游戏,我采用了HT for Web来实现,短短200行代码,我就能实现用“第一人称”来操作前进后退上下左右,并且实现了碰撞检测. 先来看下实现的效果:http://h ...

  3. Yii2之AR类的坑与总结

    本文主要记录本人从学习yii2到使用yii2开发项目过程中遇到的一些问题以及解决方法和知识点总结. 1. AR类关联哪个数据表? 默认情况下,AR类会根据类名称关联和类名相关的数据表,如:类名为Cou ...

  4. 对foreach循环的思考

    阿里java开发手册已经发表,很多都值得认真研究思考,看到零度的思考题,没忍住研究了一下. 零度的思考:https://mp.weixin.qq.com/s/dDR21k30s6ZVfDvl8BVQm ...

  5. .7-Vue源码之AST(3)

    上一节到了parseHTML函数,该函数接受一个字符串与一个对象,字符串即对应的DOM,对象包含几个字符串匹配集及3个长函数. 简略梳理部分函数代码如下: // Line-7672 function ...

  6. ajax+php(环境搭建+测试)

    在学习JavaScript,jQuery的ajax部分的时候,一直不明白要如何进行,不知道服务器要怎么弄,什么都不知道,当初在学ajax的时候,除了看一下ajax的内容,实践极少,因为,不知道要怎么做 ...

  7. 关于缓存问题:js清除缓存

    css并行加载,js串行加载(会阻塞页面) 清除缓存的问题: 1.一般手动清除,浏览器缓存 2.js代码清除缓存(原理:增加了一个参数,且该参数是一个随机数,每次都不一样,所以每次的请求参数都不一样, ...

  8. js跨域问题解决方案

     跨域:当协议.域名.端口号任何一个不相同时,叫称为跨域.   HTML5  CORS(cross-origin-resource-sharing)跨域资源共享: 原理:当需要访问跨域的资源时,可以通 ...

  9. 微信小程序异步处理

    直接看问题: 然后看打印的结果: 根据上面两图可以看出,代码上先执行的网络请求,再执行打印的变量,但是从下面打印的结果来看,先出结果的是执行打印变量的函数(aafn函数),再打印出网络请求succes ...

  10. Scrum Meeting Alpha - 1 (团队任务分解)

    团队任务分解 Alpha阶段项目目标 实现一个博客园班级博客的Android 客户端: 实现班级博客的常用功能(不包括投票.公告.校区) 有一个较为简洁美观.操作方便的界面 添加消息提醒功能. 任务拆 ...