Bacon's Cipher hdu4144 水题
来源:互联网 发布:返利直销软件 编辑:程序博客网 时间:2024/06/04 19:53
http://acm.hdu.edu.cn/showproblem.php?pid=4144
题意:用任意字母表示0,用数字表示1,每5个字符得到一个二进制数字,然后根据二进制编码,找到相应的字母,输出破译后的字符串。
#include <iostream>#include <string.h>using namespace std;#define LEN 10005char s[LEN];void decode(char *s){int i,j,t;char c=0;for (i=0;i<5;i++){if (s[i]>=48&&s[i]<=57){t=1;for (j=0;j<(4-i);j++) //这个,二进制到十进制的转换…… 自我感觉并不是很优秀的样子。t=t*2;c+=t;}}printf("%c",c+65);}int main(){#ifndef ONLINE_JUDGEfreopen("Gin.txt","r",stdin);#endifint l,i;while (scanf("%d%s",&l,s)!=EOF){for (i=0;i<l;i+=5)decode(s+i);putchar(10);}return 0;}
- Bacon's Cipher hdu4144 水题
- HDU4144:Bacon's Cipher
- hdu4144 Bacon's Cipher
- HDU4144 Bacon's Cipher
- 【字符串】hdu4144 Bacon's Cipher
- HDU 4144 Bacon's Cipher
- HDU 4144 Bacon's Cipher
- hdu 4144 Bacon's Cipher
- 17.04.29 Bacon's Cipher
- Ural 1590. Bacon’s Cipher 后缀数组
- HDU 4144Bacon's Cipher (解码)
- HDU菜鸟杯比赛第二题Bacon's Cipher
- 2011百校联动“菜鸟杯”程序设计公开赛&&Bacon's Cipher
- POJ1107 W's Cipher 【水题】
- 1042 W's Cipher
- POJ_1107_W's Cipher
- hdu4144Bacon's Cipher
- POJ1107 W's Cipher
- 小技巧:打造个性化U盘图标
- python获取汉字的拼音
- C# Thread类的应用
- MetaData Service (MDS) in OA Framework
- 软件使用配置及连接
- Bacon's Cipher hdu4144 水题
- 魏永明谈“自主”操作系统
- HDFS文件操作命令
- Oracle9i 安装完全教程
- Android学习:将ListView中id与数据库中id关联
- Android异步加载网络图片
- 简单医药项目的疾病分类二级联动
- 请试试每天吃一碗:你的白头发不见了!
- linux上ln命令详细说明