【链接】 我是链接,点我呀:)

【题意】

在这里输入题意

【题解】

输入的二进制长度最长为7
所以得开个sta[7][2^7]的样子才存的下所有的字符的。。
定义这么一个数组当字典。
然后一个字符一个字符地读。。组合成题目中的参数。
然后根据读入的每个长度为len的二进制,在字典中找到相应的字符就ok啦。

【代码】

#include <bits/stdc++.h>
using namespace std; string s;
char dic[100][100]; int readbinary(){
char key = cin.get();
while (key!='0' && key!='1') key=cin.get();
return (int)(key-'0');
} int main()
{
//freopen("/home/ccy/rush.txt","r",stdin);
ios::sync_with_stdio(0),cin.tie(0);
while (getline(cin,s)){
int cur = 2,now = 0,curlen = 1;
for (int i = 0;i < (int)s.size();i++){
if (now==cur-1) {
now = 0,cur*=2;curlen++;
}
dic[curlen][now] = s[i];
now++;
}
int len = 1;
while (len!=0){
len = 0;
for (int i = 0;i < 3;i++) {
int ju = readbinary();
len = len*2 + ju;
}
int over = 0;
while (1){
over = 1;
int temp = 0;
for (int i = 0;i < len;i++){
int ju = readbinary();
if (ju==0) over = 0;
temp = temp*2+ju;
}
if (over) break;
cout<<dic[len][temp];
}
}
cout<<endl;
cin.get();
} return 0;
}

最新文章

  1. Python 6 —— 异常
  2. 深入浅出设计模式——策略模式(Strategy Pattern)
  3. Android开发之 Android 的基本组件的概述
  4. Could not create the view: An unexpected exception was thrown.如何解决
  5. 28个你必须知道的HTML5的新特性,技巧以及技术
  6. bzoj 3165: [Heoi2013]Segment 动态凸壳
  7. 关于标准C语言的预定义宏
  8. 【LeetCode练习题】Merge Sorted Array
  9. crm使用soap删除实体
  10. POJ 1654 Area
  11. C# dev gridcontrol中添加checkbox复选框
  12. Go - concurrency
  13. Toxophily
  14. 06_java 时间获取练习_Date\SimpleDateFormat\Calendar类练习
  15. easyui datagrid 横向滚动条
  16. SpringMVC加载配置Properties文件的几种方式
  17. mysql笔记-索引
  18. CF 554A 字符串水题
  19. Tomcat --> Cannot create a server using the selected type
  20. flex弹性布局属性详解!

热门文章

  1. 学习笔记——SQL SERVER的递归
  2. Coursera Algorithms week3 归并排序 练习测验: Counting inversions
  3. Django day08 多表操作 (二) 添加表记录
  4. 二进制部署Kubernetes-v1.14.1集群
  5. Win7的虚拟Wi-Fi
  6. 2015 多校赛 第四场 1010 (hdu 5336)
  7. invoke与call
  8. Spring Boot (1) 构建第一个Spring Boot工程
  9. struts2标签(五)
  10. HTML+CSS(10)