《数据结构编程实验》 1.3.1I Think I Need a Houseboat
来源:互联网 发布:卡巴斯基软件下载 编辑:程序博客网 时间:2024/05/16 09:08
题目大意:
一个每年增大50平方英里的半圆形,给出n个点,计算每个点分别在第几年会被半圆形覆盖。
题目地址:
POJ 1005 ZOJ 1049 UVA 2363
题解:
计算点所在半圆的面积,除以50后向上取整得到年数。
#include <iostream>#include <cstdio>using namespace std;int main(){ int n,i,ans; double x,y,s; scanf("%d",&n); for (i=0;i<n;i++) { scanf("%lf%lf",&x,&y); s=(x*x+y*y)*3.14159265/2; ans=s/50+1; printf("Property %d: This property will begin eroding in year %d.\n",i+1,ans); } printf("END OF OUTPUT.\n"); return 0;}
0 0
- 《数据结构编程实验》 1.3.1I Think I Need a Houseboat
- D - I Think I Need a Houseboat(1.3.1)
- D - I Think I Need a Houseboat(1.3.1)
- D - I Think I Need a Houseboat(1.3.1)
- I Think I Need a Houseboat(1.3.1)
- 1049 I Think I Need a Houseboat
- I Think I Need a Houseboat
- 1005 I Think I Need a Houseboat
- 1005 I Think I Need a Houseboat
- I Think I Need a Houseboat
- 1005 I Think I Need a Houseboat
- 1065 I Think I Need a Houseboat
- 1005 I Think I Need a Houseboat
- I Think I Need a Houseboat
- POJ - I Think I Need a Houseboat
- poj1005---I Think I Need a Houseboat
- POJ1005 I Think I Need a Houseboat
- I Think I Need a Houseboat
- 绝对值排序
- OC中的排序算法
- 辛星浅析lvm
- Ng在coursera上的机器学习公开课——zai总结(5)_Neural Networks: Representation
- 如何成为一个牛逼的C/C++程序员?
- 《数据结构编程实验》 1.3.1I Think I Need a Houseboat
- 游戏人生
- Number Sequence
- CF 474D Flowers DP
- USACO 1.5 Superprime Rib 特殊的质数肋骨(模拟)
- HUST 1017 Exact cover
- UVa #10003 Cutting Sticks (例题9-9)
- CodingRuler
- ZOJ 3706