110103_The Trip

http://www.programming-challenges.com/pg.php?page=downloadproblem&probid=110103&format=html

UVA 10137_The Trip

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=29&page=show_problem&problem=1078

此题让人烦了好长时间,还是精度的问题,考虑不周全,看了大牛的解释和代码,终有所悟啊

这是其此题题解链接:http://blog.csdn.net/metaphysis/article/details/6432062

贴一些测试数据吧:

/*
3
10.00
20.00
30.00
4
15.00
15.01
3.00
3.01
5
5000.00
11.11
11.11
11.11
11.11
3
0.01
0.03
0.03
4
25.00
25.00
25.00
28.00
3
10.01
15.25
18.96
4
25.03
25.00
25.00
25.00


Output for this should be:

$10.00
$11.99
$3991.11
$0.01
$2.25
$4.73
$0.02
*/

你可能感兴趣的:(IP)