| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 635 人关注过本帖
标题:求助 急
只看楼主 加入收藏
chunsheng
Rank: 1
来 自:黑龙江
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-10-18
收藏
 问题点数:0 回复次数:0 
求助 急
Given a list of monetary amounts in a standard format, please calculate the total amount.

We define the format as follows:

1. The amount starts with '$'.

2. The amount could have a leading '0' if and only if it is less than 1.

3. The amount ends with a decimal point and exactly 2 following digits.

4. The digits to the left of the decimal point are separated into groups of three by commas (a group of one or two digits may appear on the left).


Input

The input consists of multiple tests. The first line of each test contains an integer N (1 <= N <= 10000) which indicates the number of amounts. The next N lines contain N amounts. All amounts and the total amount are between $0.00 and $20,000,000.00, inclusive. N=0 denotes the end of input.


Output

For each input test, output the total amount.


Sample Input

2
$1,234,567.89
$9,876,543.21
3
$0.01
$0.10
$1.00
0


Sample Output

$11,111,111.10
$1.11
搜索更多相关主题的帖子: standard total following exactly leading 
2008-10-18 11:45
快速回复:求助 急
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.040674 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved