poj 1005 I Think I Need a Houseboat
来源:互联网 发布:淘宝店铺直播招人 编辑:程序博客网 时间:2024/06/11 15:38
http://poj.org/problem?id=1005
分析:读懂题意最重要!半圆代表的意思为被腐蚀的面积,即随之时间推移,半圆面积是在不断扩大的。起初以为是陆地即为半圆,随着时间不断缩减。。。。Fred has learned that the land that is being lost forms a semicircle.
思路即为根据(x,y)确定与中心的距离,计算此时的半圆面积是几个50. 注意对于PI的处理 const double PI = 3.14159
#include"stdio.h"#include"math.h"const double PI = 3.14159;int main(){ int i = 1,n,year; double x,y,d; scanf("%d",&n); while(i<=n) { year = 1;//注意从1开始 scanf("%lf%lf",&x,&y); d = pow(x,2)+pow(y,2); year = year + PI*d/2/50; printf("Property %d: This property will begin eroding in year %d.\n",i,year); i++; } printf("END OF OUTPUT.\n"); return 0;}
阅读全文
0 0
- POJ - I Think I Need a Houseboat
- POJ-I Think I Need a Houseboat
- poj 1005 I Think I Need a Houseboat
- POJ 1005 I Think I Need a Houseboat
- (POJ 1005)I Think I Need a Houseboat
- POJ 1005 解题报告 I Think I Need a Houseboat
- 【POJ】1005 I Think I Need a Houseboat
- POJ 1005I Think I Need a Houseboat
- poj-1005 I Think I Need a Houseboat
- [POJ]1005 I Think I Need a Houseboat
- POJ 1005 I Think I Need a Houseboat
- POJ-1005 I Think I Need a Houseboat解题报告
- poj 1005 I Think I Need a Houseboat
- poj 1005 I Think I Need a Houseboat
- POJ 1005 I Think I Need a Houseboat
- poj 1005 I Think I Need a Houseboat
- POJ-1005-I Think I Need a Houseboat
- poj 1005 I Think I Need a Houseboat
- 贪婪算法——霍夫曼编码
- spring boot 静态内容 的位置
- 数串
- Reguelike 0.1v 完成小结
- 一个程序员的成长漫长之路
- poj 1005 I Think I Need a Houseboat
- java基础随笔
- Python中NumPy简介及使用举例
- 第五十七篇:VS2015建立一个完整的c++工程:头文件.h 源文件.cpp,自动生成类
- Elasticsearch-对并发冲突的解决(乐观锁、悲观锁)
- 【JZOJ 5390】【NOIP2017提高A组模拟9.26】逗气
- 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 A Weather Patterns
- 正则表达式语法
- 获取软键盘高度