RSS
![Table_bottom](/images/table_bottom.jpg?1375031774)
linjiazhen
![Avatar](/user_files/linjiazhen/config/avatar.png?1375032418)
![Table_bottom](/images/table_bottom.jpg?1375031774)
分类
![Table_bottom](/images/table_bottom.jpg?1375031774)
标签云
![Table_bottom](/images/table_bottom.jpg?1375031774)
搜索
![Table_bottom](/images/table_bottom.jpg?1375031774)
随机文章
![Table_bottom](/images/table_bottom.jpg?1375031774)
最新评论
![Table_bottom](/images/table_bottom.jpg?1375031774)
最新留言
![Table_bottom](/images/table_bottom.jpg?1375031774)
链接
![Table_bottom](/images/table_bottom.jpg?1375031774)
计数器
145695
![Table_bottom](/images/table_bottom.jpg?1375031774)
UVA 458:The Decoder
Jasonlin
posted @ 2011年3月27日 11:17
in UVA
, 2379 阅读
题目大意:
这道题是最最基础的密码学知识,就是明文的每个字母加上一个数变成密文,现在给我们密文,转化为原文。
解题思路:
找到密钥然后每个字母减去密钥。
解题代码:
#include<iostream> #include<string> using namespace std; int main(){ int t='1'-'*'; string s; while(getline(cin,s)){ int len=s.length(); for(int i=0;i<len;i++) s[i]-=t; cout<<s<<endl; } return 0; }