UVA - 10878 Decode the tape
来源:互联网 发布:奥尼尔vs霍华德数据 编辑:程序博客网 时间:2024/06/05 19:28
"Machines take me by surprise with great frequency."
Alan Turing
Your boss has just unearthed a roll of old computer tapes. The tapes have holes in them and might contain some sort of useful information. It falls to you to figure out what is written on them.
Input
The input will contain one tape.
Output
Output the message that is written on the tape.
Sample Input
___________| o . o|| o . || ooo . o|| ooo .o o|| oo o. o|| oo . oo|| oo o. oo|| o . || oo . o || ooo . o || oo o.ooo|| ooo .ooo|| oo o.oo || o . || oo .oo || oo o.ooo|| oooo. || o . || oo o. o || ooo .o o|| oo o.o o|| ooo . || ooo . oo|| o . || oo o.ooo|| ooo .oo || oo .o o|| ooo . o || o . || ooo .o || oo o. || oo .o o|| o . || oo o.o || oo . o|| oooo. o || oooo. o|| o . || oo .o || oo o.ooo|| oo .ooo|| o o.oo || o. o |___________Sample Output
A quick brown fox jumps over the lazy dog.题意:给你一段明文和译文,然后进行解码。观察可以知道,把‘0’看成 1,其他都当作0,那么就是它的二进制 ,而这一个二进制正好是对应字符的ASCII码的值#include<stdio.h>#include<iostream>#include<string.h>using namespace std;int a[]={0,0,64,32,16,8,0,4,2,1,0};int main(){char b[20];gets(b);int n;while(gets(b) && b[0] != '_'){ n = 0; int len = strlen (b);for(int i = 2;i < len; i ++){if(b[i] == 'o')n += a[i];} printf("%c",n);}return 0;}
0 0
- UVa 10878 - Decode the tape
- uva 10878 Decode the tape
- uva-10878 - Decode the tape
- uva 10878 - Decode the tape
- UVa 10878 - Decode the tape
- Uva - 10878 - Decode the tape
- UVA 10878 - Decode the tape
- UVa 10878 - Decode the tape
- UVA 10878 - Decode the tape
- UVA 10878 Decode the tape
- UVa - 10878 - Decode the tape
- UVA 10878 Decode the tape
- uva 10878 Decode the tape
- UVa 10878 - Decode the tape
- uva 10878 decode the tape
- uva - 10878 - Decode the tape
- uva 10878 Decode the tape
- UVA 10878 Decode the tape
- 使用mutt+msmtp做linux邮件客户端
- 好的 2019 数列有序!
- 转载-- lvs+haproxy的一种方式
- action配置以html结尾,现要求不把部分html文件作为action处理
- iOS 消息推送证书生成方法的简单说明
- UVA - 10878 Decode the tape
- 使用个人VPN的好处
- 第二章 构造/析构/赋值运算
- Linux下运行java项目
- C++项目Google Mock初实践(4…
- C++项目Google Mock初实践(3…
- 最快速的Android开发环境搭建ADT-Bundle及Hello World
- art.dialog使用参照
- 程序员技术练级攻略