URAL 1800 Murphy's Law(物理判断题)
2014-07-26 20:08
661 查看
1800. Murphy's Law
Time limit: 0.5 secondMemory limit: 64 MB
Anka was awarded a medal and given a buttered toast for displaying heroism in a combat. The toast was so narrow, flat, and thin that it could be regarded as a straight-line segment of length l.
On Commissar Matroskin's advice, Anka turned the toast the buttered side down and, holding it parallel to the ground, brought it to her mouth and was ready to bite, when suddenly…
The toast slipped out of her hands and started falling under gravity. It was rotating at a constant angular velocity about its center of mass in the plane perpendicular to the ground, as shown in the
picture.
Your task is to determine which side of the toast touched the ground first.
Input
The first line contains the length l of the toast in centimeters, the distance h from Anka's mouth to the ground in centimeters, and the angular velocity ω of the toast's rotationin revolutions per minute (the toast makes one revolution when it turns 360 degrees). 1 ≤ l, h, ω ≤ 1000. These numbers are integers separated with a space. The acceleration of gravity should be taken equal to 9.81 m/s2.
Output
Output “butter” if the toast first touched the ground the buttered side down and “bread” otherwise. It is guaranteed that at the moment the toast touched the ground for the first time it wasn't orthogonalto it.
Samples
input | output |
---|---|
10 400 15 | butter |
10 500 15 | bread |
#include <stdio.h> #include <math.h> #define g 9.81 int main(){ double l,h,w,s,q,t; scanf("%lf%lf%lf",&l,&h,&w); if(l/2>h) printf("butter\n"); else{ l/=100;h/=100;w/=60; h=h-l/2; t=sqrt(2*h/g); s=w*t; q=s-(int)s; if((q>=0&&q<0.25)||(q>0.75&&q<=1)) printf("butter\n"); else printf("bread\n"); } return 0; }
相关文章推荐
- 摩菲定理(Murphy's Law)
- 墨菲定律(Murphy's law)
- Murphy's Law 译为"摩非定律"--可能是软件里面总有BUG的原因
- 帕金森定律(Parkinson's Law)亦称“官场病”或“组织麻痹病”
- CL_GUI_FRONTEND_SERVICES=>FILE_EXIST(判断物理文件是否存在)
- Murphy's Laws
- MOORE'S LAW
- Amdahl's law
- poj 1659 Frogs' Neighborhood(判断序列可图)
- 2528 Mayor's posters 线段树的覆盖问题 判断一段区间是否被覆盖
- Zipf's law分析
- php 判断上传文件类型 $_files[]['type']值大全
- Amdahl's Law
- Ural 1671. Anansi's Cobweb(并查集)
- Amdahl's law
- 自己写的一个判断一个字符串里面数字和字母程序。 FUNCTION 'NUMERIC_CHECK'
- 计算机系统性能的重要估计法则:little's law
- Zipf's law
- 判断char是否为''
- for循环的条件判断中为什么用'!='而不用'<'