文件名称:dinjunhui
- 所属分类:
- 数据结构常用算法
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 184kb
- 下载次数:
- 0次
- 提 供 者:
- bangban*******
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
一天,丁俊晖编一整天的程序,突然觉得累了,于是便决定在房间内四处走走。他的房间是矩形的,他从电脑开始随便选了一个角度开始行走。由于职业习惯,丁俊晖走路始终是直线,而且碰到墙以后会反弹,入射角度与出射角度完全相同。丁俊晖会一直行走,直到灵感再次迸发。假设他的行走速度是匀速的,现在,丁俊晖的母亲想知道他一共休息了多长时间以便提醒他继续工作。
丁俊晖想考考他的母亲,于是他记录了自己碰到墙壁的序列并且告诉了她,你有没有办法能够帮助她计算出小丁所走的路程?
输入
输入包括多个测试用例,每个测试用例如下:
第一行包含两个数字 w, l(0<w, l<=1000),分别代表房间的宽度和长度;
第二行包括两个数字 x0, y0,代表电脑的位置坐标 (x0, y0);
第三行包含两个数字 x1, y1,代表丁俊晖的位置坐标 (x1, y1);
最后一行是一个包含 F , B , L , R 四种字符的字符串,分别代表墙在前面、后面、左边或是右边,字符串的长度小于等于 1000;
所有的坐标都是浮点型数字。
输出
一个浮点型数字,代表总路程,结果精确到小数点后 4 位。
-One day, Ding compiled a full day program, I suddenly felt tired, so they decided to walk around the room. His room is rectangular, and he began to pick from a computer point of view began to walk. As a habit, Ding Junhui is always walking a straight line, and hit the wall after the rebound, the incident angle and exit angle of the same. Ding Junhui will have to walk until the burst of inspiration again. Assuming he s walking speed is uniform, and now, Ding s mother wanted to know how long he was a total break to remind him to continue working.
Ding Junhui trying to quiz his mother, so he recorded his own hit the wall and told her the sequence, there is no way you can help her calculate the Ding s journey?
Enter
Input consists of multiple test cases, each test case are as follows:
The first line contains two numbers w, l (0 <w, l <= 1000), representing the width and length of the room
The second line contains two numbers x0, y0, on behalf of the computer s location
丁俊晖想考考他的母亲,于是他记录了自己碰到墙壁的序列并且告诉了她,你有没有办法能够帮助她计算出小丁所走的路程?
输入
输入包括多个测试用例,每个测试用例如下:
第一行包含两个数字 w, l(0<w, l<=1000),分别代表房间的宽度和长度;
第二行包括两个数字 x0, y0,代表电脑的位置坐标 (x0, y0);
第三行包含两个数字 x1, y1,代表丁俊晖的位置坐标 (x1, y1);
最后一行是一个包含 F , B , L , R 四种字符的字符串,分别代表墙在前面、后面、左边或是右边,字符串的长度小于等于 1000;
所有的坐标都是浮点型数字。
输出
一个浮点型数字,代表总路程,结果精确到小数点后 4 位。
-One day, Ding compiled a full day program, I suddenly felt tired, so they decided to walk around the room. His room is rectangular, and he began to pick from a computer point of view began to walk. As a habit, Ding Junhui is always walking a straight line, and hit the wall after the rebound, the incident angle and exit angle of the same. Ding Junhui will have to walk until the burst of inspiration again. Assuming he s walking speed is uniform, and now, Ding s mother wanted to know how long he was a total break to remind him to continue working.
Ding Junhui trying to quiz his mother, so he recorded his own hit the wall and told her the sequence, there is no way you can help her calculate the Ding s journey?
Enter
Input consists of multiple test cases, each test case are as follows:
The first line contains two numbers w, l (0 <w, l <= 1000), representing the width and length of the room
The second line contains two numbers x0, y0, on behalf of the computer s location
(系统自动生成,下载前可以参看下载内容)
下载文件列表
丁俊晖\Debug\vc60.idb
......\.....\vc60.pdb
......\.....\丁俊晖.exe
......\.....\丁俊晖.ilk
......\.....\丁俊晖.obj
......\.....\丁俊晖.pch
......\.....\丁俊晖.pdb
......\丁俊晖.c
......\丁俊晖.dsp
......\丁俊晖.dsw
......\丁俊晖.ncb
......\丁俊晖.opt
......\丁俊晖.plg
......\Debug
丁俊晖
......\.....\vc60.pdb
......\.....\丁俊晖.exe
......\.....\丁俊晖.ilk
......\.....\丁俊晖.obj
......\.....\丁俊晖.pch
......\.....\丁俊晖.pdb
......\丁俊晖.c
......\丁俊晖.dsp
......\丁俊晖.dsw
......\丁俊晖.ncb
......\丁俊晖.opt
......\丁俊晖.plg
......\Debug
丁俊晖