UVA213 - Message Decoding
来源:互联网 发布:北京网络教学综合平台 编辑:程序博客网 时间:2024/06/05 01:57
这个题真是不错,卡了我一下,也涨了知识。
#include<stdio.h>#include<string.h>#include<stdlib.h>#include<ctype.h>#define N 1005int str[] ={0,0,1,4,11,26,57,120};int getcc(char *a,int n){ int i,k=1; for(i=0;i<n;i++) { a[i]=getchar(); if(a[i]==10) a[i]=getchar(); if(a[i]==48) k=0; } return k;}int main(){ char s[N],a[N]; while(gets(s)!=NULL)//¶ÁÈ¡ÃÜÂë { while(1) { (void)getcc(a,3); int i,sum=0; for(i=0;i<3;i++) sum=sum*2+a[i]-48; if(!sum) break; while(1) { int sum2=0,k = getcc(a,sum); if(k) break; for(i=0;i<sum;i++) sum2=sum2*2+a[i]-48; printf("%c",s[sum2+str[sum]]); } } printf("\n"); getchar(); } return 0;}
0 0
- UVA213 - Message Decoding
- UVa213 Message Decoding
- UVa213 - Message Decoding
- UVA213----Message Decoding
- UVA213 UVALive5152 Message Decoding
- UVa213-Message Decoding
- UVa213 Message Decoding
- UVa213 Message Decoding
- UVA213 Message Decoding(二进制)
- 水题:UVa213- Message Decoding
- 算法竞赛入门经典 UVa213 Message Decoding
- Message Decoding
- Message Decoding
- 算法竞赛入门经典(第二版) 例题4-4 信息编码(Message Decoding) UVa213 Finals1991 (二进制)
- uva -213Message Decoding
- UVa 213 - Message Decoding
- UVaOJ-213 Message Decoding
- UVA【213】 Message Decoding
- JS操作cookie
- 系统基本信息 linux
- HTML入门笔记三之HTML列表和框架
- 《微信思维》摘录(一)
- windows 如何查看端口占用情况?
- UVA213 - Message Decoding
- SecureCRT如何与GNS3上的路由建立连接
- 黑马程序员——其他4:JDK1.5新特性介绍
- tar
- hdu 5131 梁山好汉
- MyEclipse错误积累--持续更新
- 几个用递归实现的简单程序
- Given preorder and inorder traversal of a tree, construct the binary tree.
- 黑马程序员——学习笔记——一个星期的颓废