| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1058 人关注过本帖
标题:一道题目急需大家帮忙 !!
只看楼主 加入收藏
狮子
Rank: 2
等 级:论坛游民
帖 子:25
专家分:13
注 册:2009-5-23
收藏
得分:0 
回复 10楼 NoSoul
good!!
2009-07-22 19:30
nuciewth
Rank: 14Rank: 14Rank: 14Rank: 14
来 自:我爱龙龙
等 级:贵宾
威 望:104
帖 子:9786
专家分:208
注 册:2006-5-23
收藏
得分:2 
是字母就是(x+5)%26.非字母原样输出。
字符串以START开始END结束(即无需处理)测试以ENDOFINPUT结束

这是哪个OJ上的题目,格式要求很怪。

倚天照海花无数,流水高山心自知。
2009-07-22 20:35
狮子
Rank: 2
等 级:论坛游民
帖 子:25
专家分:13
注 册:2009-5-23
收藏
得分:0 
回复 12楼 nuciewth
我在杭电里找到的
2009-07-22 23:48
prankmoon
Rank: 8Rank: 8
等 级:蝙蝠侠
帖 子:161
专家分:921
注 册:2009-7-21
收藏
得分:2 
以下是引用nuciewth在2009-7-22 20:35的发言:

是字母就是(x+5)%26.非字母原样输出。
字符串以START开始END结束(即无需处理)测试以ENDOFINPUT结束

这是哪个OJ上的题目,格式要求很怪。


(x+5)对应的是加密,这个是解密,要想办法减5,或者加上21.
2009-07-22 23:54
nuciewth
Rank: 14Rank: 14Rank: 14Rank: 14
来 自:我爱龙龙
等 级:贵宾
威 望:104
帖 子:9786
专家分:208
注 册:2006-5-23
收藏
得分:2 
回复 14楼 prankmoon
那就(x-5)%26

倚天照海花无数,流水高山心自知。
2009-07-23 15:16
Aron_Liu
Rank: 2
等 级:论坛游民
帖 子:22
专家分:19
注 册:2009-4-12
收藏
得分:7 
回复 楼主 狮子
First, this is a Caesar problem, you should calculate the encoding function and decoding function by hand (or at least in your mind). Then, choose a language to solve it. Java or Matlab is preferred, C,C++.... well not so good for discrete math.
I got the encoding function E(y) is congruent x + 5 (mod 26)
      and the decoding function D(x) is congruent y - 5 (mod 26).
Transfer the decoding function to any compu-language u like. (the question only ask for from the un-readable code to human-readable words, so just use the decoding function).
The question's mathmatic part is pretty simple(A -> F is the easiest case). Also, the programming language is less than 50 lines of code. GOOD LUCK. (srry i was in lab cant type chinese) :)
2009-07-23 19:22
prankmoon
Rank: 8Rank: 8
等 级:蝙蝠侠
帖 子:161
专家分:921
注 册:2009-7-21
收藏
得分:0 
nothing

[[it] 本帖最后由 prankmoon 于 2009-7-23 20:54 编辑 [/it]]
2009-07-23 20:44
快速回复:一道题目急需大家帮忙 !!
数据加载中...
 
   



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

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