UVA 10878 - Decode the tape(字符串)
来源:互联网 发布:电脑打字赚钱软件 编辑:程序博客网 时间:2024/05/22 10:54
Time Limit: 1 second
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.
___________| 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 |___________
A quick brown fox jumps over the lazy dog.
Problemsetter: Igor Naverniouk
Special thanks: BSD games ppt.
=============================
每一行代表一个ascii码,二进制表示,有 "o" 的地方为1,”.“不占二进制的位置不用管
#include <iostream>#include <cstdio>#include <cstring>using namespace std;int main(){ char str[20]; while(gets(str)) { int sum=0; if(str[0]=='_') continue; if(str[9]=='o') sum+=1; if(str[8]=='o') sum+=2; if(str[7]=='o') sum+=4; if(str[5]=='o') sum+=8; if(str[4]=='o') sum+=16; if(str[3]=='o') sum+=32; if(str[2]=='o') sum+=64; if(str[1]=='o') sum+=128; printf("%c",sum); } return 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
- Poj 1182 食物链--带边权的并查集
- 理财专题(9)——房产
- 等高线太密,如何抽稀
- NYOJ 23-取石子(一):博弈
- Codeforces Round #192 (Div. 2)
- UVA 10878 - Decode the tape(字符串)
- 编译Java时的debug信息对class文件大小的影响
- poj 3071 概率dp
- HDU--杭电--3415--Max Sum of Max-K-sub-sequence--队列--双向队列
- HDU_4239_Decoding EDSAC Data(模拟)
- Python 新手常犯错误
- mysqldump.exe 问题
- 统计元音 2027
- Cortex-A8上移植rt3070驱动出错