HDU ACM 1065 I Think I Need a Houseboat
分析:告诉协调的房子,每年(0,0)作为一个半圆区域的中心将被添加50。请教如何多年以来,这家的位置将是半圆内。注意pi必须采取3.1415926管辖权。
#include<iostream>
#include<cmath>
using namespace std; #define PI 3.1415926 //3.141592654就WA int main()
{
int T,t=0,year;
double x,y,d,s; cin>>T;
while(T--)
{
cin>>x>>y;
d=x*x+y*y; //半径的平方
s=0.5*PI*d; //半圆的面积
year=ceil(s/50.0); //向上取整
cout<<"Property "<<++t<<": This property will begin eroding in year "<<year<<".\n";
if(T==0)
cout<<"END OF OUTPUT."<<endl;
}
return 0;
}
版权声明:本文博主原创文章。博客,未经同意不得转载。
HDU ACM 1065 I Think I Need a Houseboat的更多相关文章
- hdu acm 1028 数字拆分Ignatius and the Princess III
Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K ...
- HDU ACM 1051/ POJ 1065 Wooden Sticks
Wooden Sticks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
- HDU ACM 题目分类
模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...
- hdu acm 1166 敌兵布阵 (线段树)
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submi ...
- hdu acm 2082 找单词
找单词 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...
- HDU ACM 1325 / POJ 1308 Is It A Tree?
Is It A Tree? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
- HDU ACM 1134 Game of Connections / 1130 How Many Trees?(卡特兰数)
[题目链接]http://acm.hdu.edu.cn/showproblem.php?pid=1134 [解题背景]这题不会做,自己推公式推了一段时间,将n=3和n=4的情况列出来了,只发现第n项与 ...
- HDU ACM Eight
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1043 解题背景: 看到八数码问题,没有任何的想法,偶然在翻看以前做的题的时候发现解决过类似的一道题,不 ...
- HDU ACM 1690 Bus System (SPFA)
Bus System Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
随机推荐
- Learning Cocos2d-x for WP8(6)——场景切换和场景过渡效果
原文:Learning Cocos2d-x for WP8(6)--场景切换和场景过渡效果 C#(wp7)兄弟篇 Learning Cocos2d-x for XNA(6)——场景切换和场景过渡效果 ...
- SWT的TableVierer的使用三(数据筛选和着色)
如果我们想根据某一列来过滤记录,如何实现呢?很简单,定义一个过滤器filter.这里只演示定义一个过滤器的情况.现实中你可以定义多个灵活的过滤器,通过替换过滤器来实现各种各样的过滤.一.过滤器代码: ...
- Determining IP information for eth1... failed; no link present. Check cable? 解决办法
有时候会遇到这种问题 解决办法为 进入网卡配置,将 BOOTPROTO 改为 none 然后 ifconfig –a 查看可以得到 eth1 已经可以寻到 iP 地址,如下: Service netw ...
- Xamarin 安装步骤
原文:Xamarin 安装步骤 1.下载并解压吾乐吧软件站提供的“Mono for Android 离线包” 安装:jdk-6u45-windows-i586.exe (就算你是64位系统,也要安装i ...
- JS创建 trim() 方法,此方法在IE7、IE8中不存在 需要自定义
function trim(str){ //创建空格对象 var space = new String(" "); /* str = trimLeft(str,space); st ...
- hibernate学习——Set集合配置
Set集合的配置 数据表的创建:表关系一个员工拥有多个身份 create table EMPLOYEE ( id INT NOT NULL auto_increment, first_name VAR ...
- iOS随机颜色
#import <UIKit/UIKit.h> @interface UIColor (RandomColor) +(UIColor *) randomColor; @end #impor ...
- WPF 数字小键盘Themes
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x ...
- Windows Phone开发(9):关于页面状态
原文:Windows Phone开发(9):关于页面状态 按照一般做法,刚学会如何导航,还是不够的,因为要知道,手机里面的每个页面,就如同Web页面一样,是无状态的. 啥是无状态?如果我们玩过Web开 ...
- lambda Join /Group by/ Contains
1.Join Contains