1005:I Think I Need a Houseboat-poj

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=1;i<=number;i++){int year_count=0;double area,radius;cin>>s_x>>s_y;if(s_x==0&s_y==0){break;}radius=sqrt((s_x*s_x)+(s_y*s_y));area=(PI*radius*radius)/2.0;while(area>=0){area=area-50;year_count++;}printf("Property %d: This property will begin eroding in year %d.\n",i,year_count);}printf("END OF OUTPUT.\n");}

 

转载于:https://www.cnblogs.com/gcter/p/7381549.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/400143.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【电路补习笔记】3、电感的参数与选型

目录分类电感的模型参数精度直流电阻&#xff08;DCR&#xff09;通流能力&#xff08;Irms&#xff09;自谐振频率&#xff08;SRF&#xff09;饱和电流&#xff08;Isat&#xff09;标号老师的主页&#xff1a;唐老师讲电赛 视频地址&#xff1a;唐老师讲电赛之唐老师讲电子器…

八排序算法

概述 排序有内部排序和外部排序。内部排序是数据记录在内存中进行排序&#xff0c;而外部排序是因排序的数据非常大&#xff0c;一次不能容纳所有的排序记录。在排序过程中须要訪问外存。 我们这里说说八大排序就是内部排序。 当n较大。则应採用时间复杂度为O(nlog2n)的排序方法…

wordpress CAS

https://wordpress.org/plugins/authorizer/#description 安装 Authorizer 插件&#xff0c;待测试。

poj 3436 (最大流)

题意&#xff1a;每台电脑共有p种零件&#xff0c;现在有n台机器&#xff0c;给出n台机器每台需要的一些种类零件当原料(0代表不需要&#xff0c;1代表必须要&#xff0c;2代表可有可无&#xff09;和输出的产品零件。问怎么安排生产线使生产出来零件可以组装的电脑最多。 思路…

web前端java script BOM学习笔记2017.8.1

DOM: document object model 文档对象模型提供了一套可以访问和修改HTML文档内容的方法访问&#xff1a;获取修改&#xff1a;设置1 JS要去操作HTML元素&#xff0c;必须要先用JS找到他&#xff0c;转换为JS的DOM对象操作&#xff1a;a 标签属性b css属性c 元素内容2 找对象的方…

【电路补习笔记】4、二极管的参数与选型

目录常用二极管二极管的结构与特性结构参数最大整流电流IFI_FIF​最大反向工作电压URU_RUR​反向电流IRI_RIR​最高工作频率fMf_MfM​应用常见应用单相整流电路单相半波整流电路单相桥式整流电路稳压管稳压管的伏安特性参数稳压值UZU_ZUZ​稳定电流IZI_ZIZ​额定功耗PZP_ZPZ​动…

wordpress 自定义字段

https://codex.wordpress.org/Using_Custom_Fields 显示自定义字段 <&#xff1f;php the_meta&#xff08;&#xff09;; &#xff1f;> 获取自定义字段

@font-face 使用过程

格式&#xff1a; TureTpe(.ttf)格式&#xff1a; .ttf字体是Windows和Mac的最常见的字体&#xff0c;是一种RAW格式&#xff0c;因此他不为网站优化,支持这种字体的浏览器有【IE9,Firefox3.5,Chrome4,Safari3,Opera10,iOS Mobile Safari4.2】 OpenType(.otf)格式&#xff1a;…

【电路补习笔记】5、三极管的参数与选型

目录常用的三极管型号结构作用放大三极管的三种放大组态的比较共射极放大电路单管共射放大电路&#xff08;受温度影响大&#xff09;的动态特性单管共射分压偏置放大电路的动态特性共集电极放大电路使用共基极放大电路多级放大电路多级放大电路的耦合多级放大电路的动态分析开…

WordPress函数:get_sidebar(获取侧边栏)

https://www.wpdaxue.com/get_sidebar.html 左边栏和右边栏 一个主题包含2个边栏。 1 2 3 4<?php get_header(); ?> <?php get_sidebar(left); ?> <?php get_sidebar(right); ?> <?php get_footer(); ?> 右边栏和左边栏的名字应该分别命名为…

office word 2010 怎么把左侧的标题大纲调出来?

有时候打开Word很希望出现左边的大纲&#xff0c;可是有时候就不出来&#xff0c;对word一些操作都忘得差不多了&#xff0c;这个小问题确实还是让我迷糊了一下~~网上的解决方案是&#xff1a; 打开Word2010文档窗口&#xff0c;切换到“视图”功能区。在“视图”功能区的“显示…

FFT 专题讲解

FFT是什么&#xff1f; FFT是快速傅里叶变换(fast Fourier transform)的简称。在ACM领域主要是用来快速求解多项式乘法的算法&#xff0c; 在信号领域也有很大用途 基础知识 卷积 举个例子&#xff0c;给你两个向量 \(a (a_0, a_1, a_2), b(b_0, b_1, b_2)\) a和b的卷积就是$ (…

PureMvc学习笔记

2019独角兽企业重金招聘Python工程师标准>>> PureMvc学习笔记&#xff1a; Mediator ->对应View层&#xff0c;内部绑定View对象&#xff0c;由 Mediator 对象来操作具体的视图组件。&#xff08;它的作用还包括&#xff1a;添加事件监听器&#xff0c;发送或接收…

【电路补习笔记】6、MOS管的参数与选型

目录符号寄生二极管&#xff08;体二极管&#xff09;的方向连接方法作用导通问题NMOSPMOS开关作用隔离作用引脚分辨常见型号NMOS的参数VDSS最大漏-源电压VGS最大栅源电压ID-连续漏电流VGS&#xff08;th&#xff09;RDS&#xff08;on&#xff09;导通电阻Ciss&#xff1a;输入…

HTML中 CSS去除li前面的小黑点

ul.tpl-left-nav-menu {list-style: none; } https://blog.csdn.net/qq_33833327/article/details/78652039

servlet核心API的UML图

转载于:https://www.cnblogs.com/suncoolcat/p/3339613.html

8.19noip模拟题

2017 8.19 NOIP模拟赛 by coolyangzc 共3道题目&#xff0c;时间3小时 题目名 高级打字机 不等数列 经营与开发 源文件 type.cpp/c/pas num.cpp/c/pas exploit.cpp/c/pas 输入文件 type.in num.in exploit.in 输出文件 type.out num.out exploit.out 时间限制 …

【电路补习笔记】7、磁珠的工作原理、磁珠的分类、磁珠的模型、磁珠的参数、磁珠与电感的区别、磁珠的应用、磁珠的误区

目录简介铁耗磁滞损耗磁珠归类应用对比参数用途电源滤波低通滤波器的设计符号关于单点接地老师的主页&#xff1a;唐老师讲电赛 视频地址&#xff1a;磁珠的工作原理&#xff0c;磁珠的分类&#xff0c;磁珠的模型&#xff0c;磁珠的参数磁珠与电感的区别&#xff0c;磁珠的应用…

几个常用的正则表达式

几个常用的正则表达式(下面是在javascript里面的使用方式): 1. 正则表达式的中文表示 var reg_zh/^[\u4E00-\u9FA5\uF900-\uFA2D]*$/; 2. 正则表达式的英文表示(可以拆分成大小写) var reg_en /^[a-zA-Z]$/; 3. 正则表达式判断特殊字符(可以增减字符) var reg_spechars /^(?…

wordpress教程百科

https://www.xuewangzhan.net/jz/wpbbs/