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. 使用 Prometheus + Grafana 对 Kubernetes 进行性能监控的实践

    1 什么是 Kubernetes? Kubernetes 是 Google 开源的容器集群管理系统,其管理操作包括部署,调度和节点集群间扩展等. 如下图所示为目前 Kubernetes 的架构图,由 ...

  2. oracle 表空间不足解决办法

    问题:在对某一表空间进行新建表的时候,出现ora-01658的错误. create 语句: create table OA_ORGCONFIG(  OAOC_UNID      INTEGER not ...

  3. C语言位操作

    #include <stdio.h> void print(int); int main(void) { int flag = 0xffe4; print(flag); printf(&q ...

  4. 脱壳第一讲,手工脱壳ASPack2.12的壳.ESP定律

    脱壳第一讲,手工脱壳ASPack2.12的壳.ESP定律 一丶什么是ESP定律 首先我们要明白什么是壳.壳的作用就是加密PE的. 而ESP定律就是壳在加密之前,肯定会保存所有寄存器环境,而出来的时候, ...

  5. Golang开发者常见的坑

    Golang开发者常见的坑 目录 [−] 初级 开大括号不能放在单独的一行 未使用的变量 未使用的Imports 简式的变量声明仅可以在函数内部使用 使用简式声明重复声明变量 偶然的变量隐藏Accid ...

  6. [poj1644]放苹果

    题目链接:http://poj.org/problem?id=1664       把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5, ...

  7. SVN.服务器迁移方法

    SVN项目, 源服务器  : 10.10.13.48 目标服务器: 10.10.13.129 要把SVN项目从.48上迁移到.129上. 做法: 准备: 版本库:vos 源服务器  : 10.10.1 ...

  8. angular指令的4种设计模式

    指令的功能集非常丰富,不过我们已经发现了指令的帕累托分布:使用angular编写的大量指令只会用到可用性和设计模式中很小的比例,这些指令大概可以分为4类: 只渲染指令--这些指令将渲染作用域中的数据, ...

  9. Github和Github for windows的使用简介

    很多程序员都把自己开发的代码放到Github上,方便自己管理也有利于别人查阅.所以这两天我也捣鼓了一下这个东西,现在把怎么使用Github和Github for windows简单的总结一下. 1.现 ...

  10. Building Block

    Building Block Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Tota ...