I Think I Need a Houseboat
来源:互联网 发布:淘宝账号密码大全 编辑:程序博客网 时间:2024/05/21 10:46
I Think I Need a Houseboat
时间限制:1000 ms | 内存限制:65535 KB
难度:1
- 描述
- 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.”
- 样例输入
21.0 1.025.0 0.0
#include <stdio.h>#include <math.h>#define PI 3.1415926int main(){int N;scanf("%d", &N);for(int i = 1; i <= N; i++){double x, y;scanf("%lf%lf", &x, &y);printf("Property %d: This property will begin eroding in year %d.\n", i, (int)ceil(PI*(x*x + y*y)/100));if(i == N) printf("END OF OUTPUT.\n");}return 0;}
- 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
- 1005 I Think I Need a Houseboat
- hdu1065-I Think I Need a Houseboat
- 1005:I Think I Need a Houseboat
- I Think I Need a Houseboat
- I Think I Need a Houseboat
- Android中Bitmap和Drawable
- 驾驭你的“职场布朗运动” .
- Sublime Text 2报“Decode error - output not utf-8”错误的解决办法
- powerbuilder工程的的open事件以及This apolication needs a script for its open event。窗体的命名
- http://32.duote.org/ha_vmware.zip
- I Think I Need a Houseboat
- 经典的SQL语句面试题
- 解决Oracle创建视图(VIEW)权限不足的方法
- ReadWriteLock读写锁实现线程读写互斥问题
- ubuntu右键添加打开终端的快捷菜单[转]
- wcf大文件上传配置详解
- HTML5游戏开发之俄罗斯方块(续)
- ora-01536 超出表空间限额
- css float