| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 522 人关注过本帖
标题:欢迎各大高手前来做题
只看楼主 加入收藏
虾米1号
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2008-2-29
收藏
 问题点数:0 回复次数:2 
欢迎各大高手前来做题
WACMIAN NUMBERS
In the supposedly uninhabited Wacmahara Desert, a tribe of unusual people has
been discovered. The Wacmians have only 2 fingers and a thumb on each hand,
and have invented their own numbering system. The digits they use and the
symbols they use for digits are quite unusual, but anthropologists have been able
to represent them as follows:
% represents 0
) represents 1
~ represents 2
@ represents 3
? represents 4
\ represents 5
$ represents -1 (yes, they even have a negative digit)
As you may expect, their system is base 6 where each place value is 6 times the
value to its right, as in the following examples:
)@% is 1*6*6+3*6+0 = 36+18+0 = 54
?$~~ is 4*6*6*6+(–1)*6*6+2*6+2 = 864–36+12+2 = 842
$~~ is (–1)*6*6+2*6+2 = –36+12+2 = -22

Your task is to take Wacmian numbers and represent them as standard base 10
numbers.


INPUT FORMAT
Input consists of Wacmian numbers, one per line. Each number consists of a
sequence of 1 to 10 Wacmian digits. A single ‘#’ on a line by itself indicates the
end of input.
SAMPLE INPUT:
)@%
?$~~
$~~
%
#

OUTPUT FORMAT
Output will be the corresponding decimal numbers, one per line.
SAMPLE OUTPUT:
54
842
-22
0
搜索更多相关主题的帖子: 欢迎 
2008-03-02 12:55
nuciewth
Rank: 14Rank: 14Rank: 14Rank: 14
来 自:我爱龙龙
等 级:贵宾
威 望:104
帖 子:9786
专家分:208
注 册:2006-5-23
收藏
得分:0 
so easy.
6进制转十进制嘛。

倚天照海花无数,流水高山心自知。
2008-03-02 13:21
sunkaidong
Rank: 4
来 自:南京师范大学
等 级:贵宾
威 望:12
帖 子:4496
专家分:141
注 册:2006-12-28
收藏
得分:0 
没看他写什么.看到英语就头痛......
2008-03-02 13:24
快速回复:欢迎各大高手前来做题
数据加载中...
 
   



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

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