URAL 1800 Murphy's Law(物理判断题)
来源:互联网 发布:ubuntu如何退出vim 编辑:程序博客网 时间:2024/05/16 07:38
1800. Murphy's Law
Time limit: 0.5 second
Memory limit: 64 MB
Memory 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 rotation in 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 orthogonal to it.
Samples
10 400 15
butter
10 500 15
bread
AC代码:
#include <stdio.h>#include <math.h>#define g 9.81int 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");elseprintf("bread\n");}return 0;}
0 0
- URAL 1800 Murphy's Law(物理判断题)
- 摩菲定理(Murphy's Law)
- 墨菲定律(Murphy's Law)
- 墨菲定律(Murphy's law)
- Murphy's Law
- Murphy's Computer Law + others
- Murphy's Law 译为"摩非定律"--可能是软件里面总有BUG的原因
- Murphy's Laws
- Murphy's Laws
- 胡克定律(Hooke's law)
- 软件随想录(local.joelonsoftware.com/wiki)-2003年01月25日 墨菲定律发威的一周 - A Week of Murphy's Law Gone Wild
- Amdahl's law(阿姆达尔定律)
- 利特尔定理(Little’s Law)
- Zipf's Law(map容器)
- 阿姆达尔定律(Amdahl's law)
- Moore's law & Hook's law
- Amdahl's Law
- Zipf's law分析
- poj3984
- 易语言post也挺好学的,就是抓包数据不好分析啊
- dip与px单位之间转换
- uboot配置编译
- 最大子序列和问题
- URAL 1800 Murphy's Law(物理判断题)
- atitit.提升软件开发的效率and 质量的那些强大概念and方法总结
- HDU 题目1087 Super Jumping! Jumping! Jumping!
- hdu 1253 胜利大逃亡(bfs)
- Cracking coding interview(2.1)去除LinkedList中的重复元素
- SDUTOJ 1480 数据结构实验:哈希表——链地址法处理冲突
- 非常读一
- POJ2182 Lost Cows
- 非常读一